Skip to content

Commit ad4568b

Browse files
authored
Merge pull request #24 from Iterable/MOB-11359-remove-unnecessary-configs
[MOB-11359] remove-unnecessary-configs
2 parents 525c1e0 + 1792bf6 commit ad4568b

File tree

6 files changed

+37
-26
lines changed

6 files changed

+37
-26
lines changed

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ the native code is generated through `expo prebuild`.
2424
- [Troubleshooting](#troubleshooting)
2525
- [Native Module Not Found](#native-module-not-found)
2626
- [Failed to delete [ios|android] code: ENOTEMPTY: directory not empty](#failed-to-delete-iosandroid-code-enotempty-directory-not-empty)
27+
- [Contributing](#contributing)
2728
- [License](#license)
29+
- [Support](#support)
2830
- [Further Reading](#further-reading)
2931

3032
<!-- /code_chunk_output -->
@@ -86,7 +88,6 @@ Add the plugin to your `app.json` or `app.config.js`:
8688
"autoConfigurePushNotifications": true,
8789
"enableTimeSensitivePush": true,
8890
"requestPermissionsForPushNotifications": true,
89-
"enableInAppMessages": true
9091
}]
9192
]
9293
}
@@ -97,12 +98,11 @@ Add the plugin to your `app.json` or `app.config.js`:
9798
9899
| Option | Type | Default | Description |
99100
|--------|------|---------|-------------|
100-
| `apiKey` | string | - | Your Iterable API key |
101-
| `appEnvironment` | 'development' \| 'production' | 'development' | The environment for your app |
102-
| `autoConfigurePushNotifications` | boolean | true | Whether to automatically configure push notifications |
103-
| `enableTimeSensitivePush` | boolean | true | Whether to enable time-sensitive push notifications (ios only) |
104-
| `requestPermissionsForPushNotifications` | boolean | true | Whether to request permissions for push notifications (ios only) |
105-
| `enableInAppMessages` | boolean | true | Whether to enable in-app messages |
101+
| `apiKey` | string | `''` | Your Iterable project API key |
102+
| `appEnvironment` | `'development'` \| `'production'` | `'development'` | The environment of your app |
103+
| `autoConfigurePushNotifications` | boolean | `true` | Whether to automatically configure push notifications. Set to `false` if you want to configure push notifications manually. <br><br> **WARNING**: Iterable cannot guarantee compatibility with custom push notification configurations. |
104+
| `enableTimeSensitivePush` | boolean | `true` | Whether to enable time-sensitive push notifications (iOS only) |
105+
| `requestPermissionsForPushNotifications` | boolean | `false` | Whether to request permissions for push notifications (iOS only) |
106106
107107
### Disabling New Architecture
108108
`@iterable/react-native-sdk` is *NOT* compatible with Reacts New Architecture,
@@ -315,9 +315,21 @@ Sometimes this error appears when running `npx expo prebuild --clean`. It seems
315315
to be an intermittent bug within expo. It usually works upon running the same
316316
command a second time, so just try again.
317317
318+
## Contributing
319+
320+
Contributions are welcome! Please feel free to submit a Pull Request.
321+
318322
## License
319323
320-
MIT
324+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
325+
for details.
326+
327+
## Support
328+
329+
For support, please:
330+
1. Check the [documentation](https://github.com/Iterable/iterable-expo-plugin#readme)
331+
2. Open an [issue](https://github.com/Iterable/iterable-expo-plugin/issues)
332+
3. Contact [Iterable support](https://support.iterable.com/hc/en-us/requests/new)
321333
322334
## Further Reading
323335
- [Installing Iterables React Native

example/app.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"backgroundColor": "#ffffff"
2727
},
2828
"package": "expo.modules.adapters.iterable.example",
29-
"googleServicesFile": "./google-services.json",
3029
"intentFilters": [
3130
{
3231
"action": "MAIN",
@@ -71,7 +70,6 @@
7170
"apiKey": "YOUR_ITERABLE_API_KEY",
7271
"appEnvironment": "development",
7372
"autoConfigurePushNotifications": true,
74-
"enableInAppMessages": true,
7573
"enableTimeSensitivePush": true,
7674
"requestPermissionsForPushNotifications": true
7775
}

ios/ExpoAdapterIterable/IterableAppDelegate.swift

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,10 @@ public class IterableAppDelegate: ExpoAppDelegateSubscriber, UIApplicationDelega
3535
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
3636
) {
3737

38-
if Bundle.main.object(
39-
forInfoDictionaryKey: "ITERABLE_ENABLE_IN_APP_MESSAGES") as? Bool == true
40-
{
41-
IterableAppIntegration.application(
42-
application, didReceiveRemoteNotification: userInfo,
43-
fetchCompletionHandler: completionHandler
44-
)
45-
}
38+
IterableAppIntegration.application(
39+
application, didReceiveRemoteNotification: userInfo,
40+
fetchCompletionHandler: completionHandler
41+
)
4642
}
4743

4844
public func application(

plugin/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const withIterable: ConfigPlugin<ConfigPluginProps> = (config, props = {}) => {
1919
enableTimeSensitivePush: props.enableTimeSensitivePush ?? true,
2020
requestPermissionsForPushNotifications:
2121
props.requestPermissionsForPushNotifications ?? false,
22-
enableInAppMessages: props.enableInAppMessages ?? true,
2322
};
2423

2524
return withPlugins(config, [

plugin/src/withIterable.types.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,31 @@ export interface ConfigPluginProps {
1010
appEnvironment?: 'development' | 'production';
1111
/**
1212
* Whether to automatically configure push notifications.
13+
*
14+
* If true, this will set up the necessary permissions and configurations for
15+
* push notifications according to the Iterable SDK documentation. If you
16+
* would like to build your own push notification configuration, set this to
17+
* false -- but do so with caution as Iterable cannot guarantee compatibility
18+
* with custom push notification configurations.
1319
* @default true
1420
*/
1521
autoConfigurePushNotifications?: boolean;
1622
/**
1723
* Whether to enable time-sensitive push notifications.
24+
*
25+
* (iOS only)
26+
*
1827
* @default true
1928
*/
2029
enableTimeSensitivePush?: boolean;
2130
/**
2231
* Whether to request permissions for push notifications.
32+
*
33+
* (iOS only)
34+
*
2335
* @default false
2436
*/
2537
requestPermissionsForPushNotifications?: boolean;
26-
/**
27-
* Whether to enable in-app messages.
28-
* @default true
29-
*/
30-
enableInAppMessages?: boolean;
3138
}
3239

3340
export type ConfigPluginPropsWithDefaults = Required<ConfigPluginProps>;

plugin/src/withStoreConfigValues.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { type ConfigPluginPropsWithDefaults } from './withIterable.types';
1515
*/
1616
type JsKey = keyof Pick<
1717
ConfigPluginPropsWithDefaults,
18-
'apiKey' | 'requestPermissionsForPushNotifications' | 'enableInAppMessages'
18+
'apiKey' | 'requestPermissionsForPushNotifications'
1919
>;
2020

2121
/**
@@ -35,7 +35,6 @@ const nativeKeyMap: Record<JsKey, NativeKey> = {
3535
apiKey: 'ITERABLE_API_KEY',
3636
requestPermissionsForPushNotifications:
3737
'ITERABLE_REQUEST_PERMISSIONS_FOR_PUSH_NOTIFICATIONS',
38-
enableInAppMessages: 'ITERABLE_ENABLE_IN_APP_MESSAGES',
3938
};
4039

4140
const withStoreValuesOnIos: ConfigPlugin<ConfigPluginPropsWithDefaults> = (

0 commit comments

Comments
 (0)