Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fixed issues with adding file to target #10

Merged
merged 16 commits into from Dec 10, 2022
2 changes: 1 addition & 1 deletion .releaserc.json
Expand Up @@ -16,7 +16,7 @@
"changelogFile": "CHANGELOG.md"
}],
["@semantic-release/exec",{
"verifyReleaseCmd": "./scripts/update-version.sh 1.0.0-alpha.4"
"verifyReleaseCmd": "./scripts/update-version.sh ${nextRelease.version}"
}
],
["@semantic-release/git", {
Expand Down
14 changes: 8 additions & 6 deletions README.md
Expand Up @@ -7,7 +7,7 @@

![min swift version is 5.3](https://img.shields.io/badge/min%20Swift%20version-5.3-orange)
![min ios version is 13](https://img.shields.io/badge/min%20iOS%20version-13-blue)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](code_of_conduct.md)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](code_of_conduct.md)
[![codecov](https://codecov.io/gh/customerio/customerio-expo-plugin/branch/develop/graph/badge.svg?token=IZ9RP9XD1O)](https://codecov.io/gh/customerio/customerio-expo-plugin)

# Customer.io Expo Plugin
Expand Down Expand Up @@ -71,10 +71,6 @@ By default, the plugin expects to use Apple's Push Notification service (APNs) f
}
```

1. Go to `ios/{your_appname}.xcworkspace` in XCode.
1. Right-click the main target `{your_appname}` and click **Add files to "{your_appname}"**.
1. Select `{your_appname}/PushNotification.swift` and click **Add**.

1. Add an import statement to your project for the react native library. We haven't included it below, but you can import `CioLogLevel` to set log outputs to something other than `error`; this may help you debug your application.
```javascript
import { CustomerIO, CustomerioConfig, CustomerIOEnv, Region } from ‘customerio-reactnative’;
Expand Down Expand Up @@ -140,6 +136,12 @@ The `customerio-expo-plugin` supports the following configuration options. In mo
<td><code>false</code></td>
<td>Enables rich push for iOS</td>
</tr>
<tr>
<td style="white-space:nowrap;"><code>ios.useFrameworks</code></td>
<td>string</td>
<td><code>undefined</code></td>
<td>This is optional, it allows the plugin to work with static libraries. Options are <code>static</code> and <code>dynamic</code></td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -182,7 +184,7 @@ See our complete SDK documentation at [https://customer.io/docs/sdk/expo/](https

Thanks for taking an interest in our project! We welcome your contributions.

We value an open, welcoming, diverse, inclusive, and healthy community for this project. We expect all contributors to follow our [code of conduct](CODE_OF_CONDUCT.md).
We value an open, welcoming, diverse, inclusive, and healthy community for this project. We expect all contributors to follow our [code of conduct](CODE_OF_CONDUCT.md).

# License

Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -40,7 +40,7 @@
"registry": "https://registry.npmjs.org/"
},
"peerDependencies": {
"customerio-reactnative": "*"
"customerio-reactnative": ">=1.0.1-alpha.3"
xtreem88 marked this conversation as resolved.
Show resolved Hide resolved
},
"devDependencies": {
"@expo/config-plugins": "^4.1.4",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/constants/ios.ts
@@ -1,6 +1,6 @@
export const LOCAL_PATH_TO_CIO_NSE_FILES = `node_modules/customerio-expo-plugin/src/helpers/native-files/ios`;
export const IOS_DEPLOYMENT_TARGET = '13.0';
export const CIO_SDK_VERSION = '1.2.6';
export const CIO_SDK_VERSION = '2.0.0-alpha.1';
xtreem88 marked this conversation as resolved.
Show resolved Hide resolved
export const CIO_PODFILE_REGEX = /pod 'CustomerIO\/MessagingPushAPN'/;
export const CIO_CIO_TARGET_REGEX = /cio_target_names/;
export const CIO_PODFILE_NOTIFICATION_REGEX = /target 'NotificationService' do/;
Expand Down
89 changes: 0 additions & 89 deletions src/ios/withAppDelegateXcodeProject.ts

This file was deleted.

7 changes: 1 addition & 6 deletions src/ios/withCIOIos.ts
Expand Up @@ -2,21 +2,16 @@ import type { ExpoConfig } from '@expo/config-types';

import type { CustomerIOPluginOptionsIOS } from '../types/cio-types';
import { withAppDelegateModifications } from './withAppDelegateModifications';
import { withCioAppdelegateXcodeProject } from './withAppDelegateXcodeProject';
import { withCioNotificationsXcodeProject } from './withNotificationsXcodeProject';
import { withCioXcodeProject } from './withXcodeProject';

export function withCIOIos(
config: ExpoConfig,
props: CustomerIOPluginOptionsIOS
) {
if (props.pushNotification?.useRichPush) {
config = withCioNotificationsXcodeProject(config, props);
}

if (props.pushNotification) {
config = withAppDelegateModifications(config, props);
config = withCioAppdelegateXcodeProject(config, props);
config = withCioNotificationsXcodeProject(config, props);
}

config = withCioXcodeProject(config, props);
Expand Down