Expo plugin options reference
Option | Type | Description |
|---|---|---|
| string | The Client ID found in your WonderPush dashboard. |
| string | The Client Secret found in your WonderPush dashboard. |
| string containing only digits | The Sender ID found in your Firebase Cloud Messaging settings. |
| boolean | Allows deactivation of the automatic initialization of the SDK |
| boolean | Controls debug logging. |
| boolean | Controls whether user consent is required for the SDK to operate. |
| boolean | Controls whether geolocation is collected or not. |
| boolean | Controls whether to allow starting a React Native context in background to react to received push notifications with the WonderPush Delegate. |
|
| APS environment to use for the iOS entitlements |
|
| The default notification color on Android, as a hexadecimal value. Mutually exclusive with |
|
| The default notification color on Android, as an Android color resource reference. Mutually exclusive with |
|
| The default notification icon on Android, as an Android resource reference, but file names are accepted too. |
| an array of path to image assets | A list of image assets to include as resources in the application in the proper sizes to be used as small icons in Android notifications. |
| an array of path to image assets | A list of image assets to include as resources in the application in the proper sizes to be used as large icons in Android notifications. |
Configuration options
The wonderpush-expo-plugin is configured in your app.json or app.config.js or app.config.ts file as follows:
{
"expo": {
// …
"plugins": [
// …
[
"wonderpush-expo-plugin",
{
// List the plugin options detailed in this page here.
// For example:
"clientId": "YOUR_CLIENT_ID",
"clientSecret": "YOUR_CLIENT_SECRET",
"senderId": "YOUR_SENDER_ID"
}
]
]
}
}The entries inside the
expo.pluginsarray can be a single plugin name as a string without the mean to give options, or an array with the plugin name as first element and an object for the options as second element.So you need to have an array within an array to provide the options. Take extra care the first time you edit this.
clientId
clientIdThe Client ID found in your WonderPush dashboard. Follow the (XXX) Expo Push Notifications quickstart guide.
This option is mandatory unless you have an integration use case that requires determining this value at run time. In such case you will need to call WonderPush.initializeAndRememberCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET") during your application startup.
clientSecret
clientSecretThe Client Secret found in your WonderPush dashboard. Follow the (XXX) Expo Push Notifications quickstart guide.
This option is mandatory unless you have an integration use case that requires determining this value at run time. In such case you will need to call WonderPush.initializeAndRememberCredentials("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET") during your application startup.
senderId
senderIdThe Sender ID found in your Firebase Cloud Messaging settings. Follow the (XXX) Expo Push Notifications quickstart guide.
If your application integrates the Google Services, this can be automatically determined. It is recommended to explicit set this option anyways, otherwise your push tokens will be tied to WonderPush and won't be portable.
autoInit
autoInitPermits to deactivate the automatic initialization of the SDK. The default is true.
logging
loggingControls debug logging. The default is false.
You can enable it for debug builds but you should disable it for release builds.
requiresUserConsent
requiresUserConsentControls whether user consent is required before doing anything. The default is false.
geolocation
geolocationControls whether geolocation is collected or not. The default is true.
The system permission is required for the collection to be effective. WonderPush does not automatically prompt your users for this permission. The collection is hence only opportunistic, if your app already uses it.
allowBackgroundStart
allowBackgroundStartIf you use WonderPush.setDelegate() to receive events from WonderPush when a notification is received or to alter the deeplink, you need to opt into WonderPush starting a React Native context of your application in the background.
Make sure your app does not run code that assumes the application is is foreground until it actually is in the foreground, as starting a React Native context will evaluate the JavaScript of your application.
If you do not activate this, the WonderPush Delegate will only call your code if the events happen while your application is already running.
The default is false.
ios.apsEnvironment
ios.apsEnvironmentAllows you to force que value of the aps-environment entitlement for iOS if ever need be.
The default is "development", like Xcode configures when activating the Push notifications capability.
The dot in this option name refers to a sub-field. Give this option as "ios": { "apsEnvironment": "development" }, for example.
android.defaultNotificationColor
android.defaultNotificationColorSelects the default color for your Android notifications, used for tinting the notification small icon.
Accepts values in hexadecimal format with optional # and alpha channel (which is replaced by full opacity by Android anyway): "#RRGGBB" or "#AARRGGBB" or "RRGGBB" or "AARRGGBB".
This option is mutually exclusive with android.defaultNotificationColorResource.
The dot in this option name refers to a sub-field. Give this option as "android": { "defaultNotificationColor": "#FF8000" }, for example for an orange tint.
android.defaultNotificationColorResource
android.defaultNotificationColorResourceIf you already have @color resources in your application, you can use this option instead of the easier android.defaultNotificationColor to reference it.
Accepts "@color/resource_name" values.
This option is mutually exclusive with android.defaultNotificationColor, which is often the simpler alternative for most setups.
The dot in this option name refers to a sub-field. Give this option as "android": { "defaultNotificationColorResource": "…" }.
android.defaultNotificationIconResource
android.defaultNotificationIconResourceSelects the default icon you want to use for your Android notifications instead of the default bell icon.
This references a drawable resource resource in your Android application. Use the android.smallIcons option to add the necessary image assets as drawable resources and reference the name of the one you want to use by default.
Values are expected to be like "@drawable/resource_name".
For convenience, we also accept "resource_name" or file references like "/path/to/resource_name.ext" and transform them accordingly.
{
"expo": {
// …
"plugins": [
// …
[
"wonderpush-expo-plugin",
{
"android": {
"defaultNotificationIconResource": "@drawable/my_notification_icon_mask",
"smallIcons": ["./my_notification_icon_mask.png"]
}
}
]
]
}
}android.smallIcons
android.smallIconsAccepts a list of paths to image assets to include into your Android application as assets.
Avoid - in file names and prefer _.
Images should be 96×96 px, white on transparent, used as masks by Android. Each image will be resized to the appropriate size variants.
You can use the base name of the file as the resource name. For example if you give the list ["./assets/logo_notification_icon_mask.png", "./assets/coupon_notification_icon_mask.png"] then the resources @drawable/logo_notification_icon_mask and @drawable/coupon_notification_icon_mask are now valid resources you can use, for instance in the android.defaultNotificationIconResource option described above.
The dot in this option name refers to a sub-field. Give this option as "android": { "smallIcons": ["…", …] }.
android.largeIcons
android.largeIconsYou most likely do not need this option. It's here for completeness.
Usually notifications are sent with a URL to an image as the notification large icon for Android, field instead of referencing a resource bundled inside application.
Accepts a list of paths to image assets to include into your Android application as assets.
Avoid - in file names and prefer _.
Images should be 256×256 px. Each image will be resized to the appropriate size variants.
You can use the base name of the file as the resource name. For example if you give the list ["./assets/logo_large_notification_icon.png", "./assets/super_deal_large_notification_icon.png"] then the resources @drawable/logo_large_notification_icon and @drawable/super_deal_large_notification_icon are now valid resources you can use.
Those resources are not meant for use in the android.defaultNotificationIconResource option described above as it expects white on transparent masks instead.
The dot in this option name refers to a sub-field. Give this option as "android": { "largeIcons": ["…", …] }.
Updated about 17 hours ago
