OneSignal plugin for Capacitor v8+ only.
npm install capacitor-native-onesignalOneSignal push notification and in-app messaging plugin for Capacitor v8+.
This plugin integrates OneSignal SDK v5.x for iOS and Android with Capacitor v8+ applications.
- Push notifications with rich content support
- In-app messaging
- User segmentation with tags and aliases
- Email and SMS subscriptions
- Live Activities support (iOS 16.1+)
- Location-based targeting
- Privacy/consent management
``bash`
npm install capacitor-native-onesignal
npx cap sync
Add the following to your ios/App/App/AppDelegate.swift:
`swift
import OneSignalFramework
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// OneSignal is initialized via the Capacitor plugin
return true
}
`
Enable Push Notifications capability in Xcode:
1. Select your project target
2. Go to "Signing & Capabilities"
3. Add "Push Notifications" capability
4. Add "Background Modes" capability and enable "Remote notifications"
No additional setup required. The plugin automatically configures the OneSignal SDK.
For Firebase Cloud Messaging, ensure you have:
1. Added google-services.json to android/app/android/app/build.gradle
2. Applied the Google Services plugin in your
`typescript
import { OneSignal } from 'capacitor-native-onesignal';
// Initialize with your OneSignal App ID
await OneSignal.initialize({ appId: 'YOUR_ONESIGNAL_APP_ID' });
`
`typescript`
const { permission } = await OneSignal.requestPermission({ fallbackToSettings: true });
console.log('Permission granted:', permission);
`typescript
// Login a user
await OneSignal.login({ externalId: 'user-123' });
// Logout user
await OneSignal.logout();
`
`typescript
// Add a single tag
await OneSignal.addTag({ key: 'level', value: '5' });
// Add multiple tags
await OneSignal.addTags({ tags: { level: '5', score: '1000' } });
// Get tags
const { tags } = await OneSignal.getTags();
console.log('Tags:', tags);
// Remove tags
await OneSignal.removeTags({ keys: ['level', 'score'] });
`
`typescript
// Notification clicked
OneSignal.addListener('notificationClicked', (event) => {
console.log('Notification clicked:', event.notification);
console.log('Action:', event.result);
});
// Notification will display in foreground
OneSignal.addListener('notificationWillDisplay', (event) => {
console.log('Notification will display:', event.notification);
});
// Permission changed
OneSignal.addListener('permissionChanged', (event) => {
console.log('Permission changed:', event.permission);
});
`
`typescript
// Add triggers for in-app messages
await OneSignal.addTrigger({ key: 'screen', value: 'home' });
// Pause in-app messages
await OneSignal.setInAppMessagesPaused({ paused: true });
// Listen for in-app message clicks
OneSignal.addListener('inAppMessageClicked', (event) => {
console.log('In-app message clicked:', event.message);
});
`
`typescript
// Opt in/out of push notifications
await OneSignal.optIn();
await OneSignal.optOut();
// Get subscription info
const { subscriptionId } = await OneSignal.getPushSubscriptionId();
const { token } = await OneSignal.getPushSubscriptionToken();
const { optedIn } = await OneSignal.getOptedIn();
`
* initialize(...)
* login(...)
* logout()
* setConsentRequired(...)
* setConsentGiven(...)
* setLogLevel(...)
* setAlertLevel(...)
* addTag(...)
* addTags(...)
* removeTag(...)
* removeTags(...)
* getTags()
* addAlias(...)
* addAliases(...)
* removeAlias(...)
* removeAliases(...)
* addEmail(...)
* removeEmail(...)
* addSms(...)
* removeSms(...)
* setLanguage(...)
* getOnesignalId()
* getExternalId()
* getPermission()
* permissionNative()
* requestPermission(...)
* canRequestPermission()
* registerForProvisionalAuthorization()
* clearAllNotifications()
* removeNotification(...)
* removeGroupedNotifications(...)
* getPushSubscriptionId()
* getPushSubscriptionToken()
* getOptedIn()
* optIn()
* optOut()
* addTrigger(...)
* addTriggers(...)
* removeTrigger(...)
* removeTriggers(...)
* clearTriggers()
* setInAppMessagesPaused(...)
* getInAppMessagesPaused()
* setLocationShared(...)
* getLocationShared()
* requestLocationPermission()
* enterLiveActivity(...)
* exitLiveActivity(...)
* setPushToStartToken(...)
* removePushToStartToken(...)
* addListener('notificationClicked', ...)
* addListener('notificationWillDisplay', ...)
* addListener('permissionChanged', ...)
* addListener('pushSubscriptionChanged', ...)
* addListener('userChanged', ...)
* addListener('inAppMessageClicked', ...)
* addListener('inAppMessageWillDisplay', ...)
* addListener('inAppMessageDidDisplay', ...)
* addListener('inAppMessageWillDismiss', ...)
* addListener('inAppMessageDidDismiss', ...)
* removeAllListeners()
* Interfaces
* Type Aliases
* Enums
`typescript`
initialize(options: { appId: string; }) => Promise
Initialize the OneSignal SDK with your app ID.
Must be called before any other OneSignal methods.
| Param | Type | Description |
| ------------- | ------------------------------- | ------------------------------------------------- |
| options | { appId: string; } | - The initialization options containing the appId |
--------------------
`typescript`
login(options: { externalId: string; }) => Promise
Login a user with their external user ID.
This will associate the current device with the user.
| Param | Type | Description |
| ------------- | ------------------------------------ | --------------------------------------------- |
| options | { externalId: string; } | - The login options containing the externalId |
--------------------
`typescript`
logout() => Promise
Logout the current user.
This will disassociate the current device from the user.
--------------------
`typescript`
setConsentRequired(options: { required: boolean; }) => Promise
Set whether user consent is required before data is sent to OneSignal.
Must be called before initialize() if you require consent.
| Param | Type | Description |
| ------------- | ----------------------------------- | ----------------------------- |
| options | { required: boolean; } | - Whether consent is required |
--------------------
`typescript`
setConsentGiven(options: { given: boolean; }) => Promise
Set whether the user has given consent for data collection.
| Param | Type | Description |
| ------------- | -------------------------------- | -------------------------- |
| options | { given: boolean; } | - Whether consent is given |
--------------------
`typescript`
setLogLevel(options: { logLevel: LogLevel; }) => Promise
Set the log level for the OneSignal SDK.
| Param | Type | Description |
| ------------- | ------------------------------------------------------------ | ---------------------- |
| options | { logLevel: LogLevel; } | - The log level to set |
--------------------
`typescript`
setAlertLevel(options: { logLevel: LogLevel; }) => Promise
Set the visual log level (shows alerts for logs at or above this level).
| Param | Type | Description |
| ------------- | ------------------------------------------------------------ | ------------------------ |
| options | { logLevel: LogLevel; } | - The alert level to set |
--------------------
`typescript`
addTag(options: { key: string; value: string; }) => Promise
Add a single tag to the current user.
| Param | Type | Description |
| ------------- | -------------------------------------------- | ------------------------------ |
| options | { key: string; value: string; } | - The key and value of the tag |
--------------------
`typescript`
addTags(options: { tags: Record
Add multiple tags to the current user.
| Param | Type | Description |
| ------------- | -------------------------------------------------------------------------- | ----------------- |
| options | { tags: Record<string, string>; } | - The tags to add |
--------------------
`typescript`
removeTag(options: { key: string; }) => Promise
Remove a tag from the current user.
| Param | Type | Description |
| ------------- | ----------------------------- | ------------------------------ |
| options | { key: string; } | - The key of the tag to remove |
--------------------
`typescript`
removeTags(options: { keys: string[]; }) => Promise
Remove multiple tags from the current user.
| Param | Type | Description |
| ------------- | -------------------------------- | -------------------------------- |
| options | { keys: string[]; } | - The keys of the tags to remove |
--------------------
`typescript`
getTags() => Promise<{ tags: Record
Get the tags for the current user.
Returns: Promise<{ tags: Record<string, string>; }>
--------------------
`typescript`
addAlias(options: { label: string; id: string; }) => Promise
Add an alias for the current user.
| Param | Type | Description |
| ------------- | ------------------------------------------- | ------------------------ |
| options | { label: string; id: string; } | - The alias label and ID |
--------------------
`typescript`
addAliases(options: { aliases: Record
Add multiple aliases for the current user.
| Param | Type | Description |
| ------------- | ----------------------------------------------------------------------------- | -------------------- |
| options | { aliases: Record<string, string>; } | - The aliases to add |
--------------------
`typescript`
removeAlias(options: { label: string; }) => Promise
Remove an alias from the current user.
| Param | Type | Description |
| ------------- | ------------------------------- | --------------------------- |
| options | { label: string; } | - The alias label to remove |
--------------------
`typescript`
removeAliases(options: { labels: string[]; }) => Promise
Remove multiple aliases from the current user.
| Param | Type | Description |
| ------------- | ---------------------------------- | ---------------------------- |
| options | { labels: string[]; } | - The alias labels to remove |
--------------------
`typescript`
addEmail(options: { email: string; }) => Promise
Add an email address to the current user.
| Param | Type | Description |
| ------------- | ------------------------------- | -------------------------- |
| options | { email: string; } | - The email address to add |
--------------------
`typescript`
removeEmail(options: { email: string; }) => Promise
Remove an email address from the current user.
| Param | Type | Description |
| ------------- | ------------------------------- | ----------------------------- |
| options | { email: string; } | - The email address to remove |
--------------------
`typescript`
addSms(options: { smsNumber: string; }) => Promise
Add an SMS number to the current user.
| Param | Type | Description |
| ------------- | ----------------------------------- | ----------------------- |
| options | { smsNumber: string; } | - The SMS number to add |
--------------------
`typescript`
removeSms(options: { smsNumber: string; }) => Promise
Remove an SMS number from the current user.
| Param | Type | Description |
| ------------- | ----------------------------------- | -------------------------- |
| options | { smsNumber: string; } | - The SMS number to remove |
--------------------
`typescript`
setLanguage(options: { language: string; }) => Promise
Set the language for the current user.
| Param | Type | Description |
| ------------- | ---------------------------------- | -------------------------------------- |
| options | { language: string; } | - The language code (e.g., "en", "es") |
--------------------
`typescript`
getOnesignalId() => Promise<{ onesignalId: string | null; }>
Get the OneSignal ID for the current user.
Returns: Promise<{ onesignalId: string | null; }>
--------------------
`typescript`
getExternalId() => Promise<{ externalId: string | null; }>
Get the external ID for the current user.
Returns: Promise<{ externalId: string | null; }>
--------------------
`typescript`
getPermission() => Promise<{ permission: boolean; }>
Check if push notification permission has been granted.
Returns: Promise<{ permission: boolean; }>
--------------------
`typescript`
permissionNative() => Promise<{ permission: OSNotificationPermission; }>
Get the native permission status.
Returns: Promise<{ permission: OSNotificationPermission; }>
--------------------
`typescript`
requestPermission(options?: { fallbackToSettings?: boolean | undefined; } | undefined) => Promise<{ permission: boolean; }>
Request push notification permission from the user.
| Param | Type | Description |
| ------------- | ---------------------------------------------- | ---------------------------------------------- |
| options | { fallbackToSettings?: boolean; } | - Optional settings for the permission request |
Returns: Promise<{ permission: boolean; }>
--------------------
`typescript`
canRequestPermission() => Promise<{ canRequest: boolean; }>
Check if permission can be requested.
Returns: Promise<{ canRequest: boolean; }>
--------------------
`typescript`
registerForProvisionalAuthorization() => Promise<{ accepted: boolean; }>
Register for provisional authorization (iOS only).
Allows sending notifications to the Notification Center without prompting.
Returns: Promise<{ accepted: boolean; }>
--------------------
`typescript`
clearAllNotifications() => Promise
Clear all notifications created by OneSignal.
--------------------
`typescript`
removeNotification(options: { notificationId: number; }) => Promise
Remove a specific notification by its Android notification ID.
| Param | Type | Description |
| ------------- | ---------------------------------------- | ------------------------------- |
| options | { notificationId: number; } | - The notification ID to remove |
--------------------
`typescript`
removeGroupedNotifications(options: { groupKey: string; }) => Promise
Remove all notifications in a group (Android only).
| Param | Type | Description |
| ------------- | ---------------------------------- | ------------------------- |
| options | { groupKey: string; } | - The group key to remove |
--------------------
`typescript`
getPushSubscriptionId() => Promise<{ subscriptionId: string | null; }>
Get the push subscription ID.
Returns: Promise<{ subscriptionId: string | null; }>
--------------------
`typescript`
getPushSubscriptionToken() => Promise<{ token: string | null; }>
Get the push subscription token.
Returns: Promise<{ token: string | null; }>
--------------------
`typescript`
getOptedIn() => Promise<{ optedIn: boolean; }>
Check if the user is opted in to push notifications.
Returns: Promise<{ optedIn: boolean; }>
--------------------
`typescript`
optIn() => Promise
Opt the user in to push notifications.
--------------------
`typescript`
optOut() => Promise
Opt the user out of push notifications.
--------------------
`typescript`
addTrigger(options: { key: string; value: string; }) => Promise
Add a trigger for in-app messages.
| Param | Type | Description |
| ------------- | -------------------------------------------- | --------------------------- |
| options | { key: string; value: string; } | - The trigger key and value |
--------------------
`typescript`
addTriggers(options: { triggers: Record
Add multiple triggers for in-app messages.
| Param | Type | Description |
| ------------- | ------------------------------------------------------------------------------ | --------------------- |
| options | { triggers: Record<string, string>; } | - The triggers to add |
--------------------
`typescript`
removeTrigger(options: { key: string; }) => Promise
Remove a trigger for in-app messages.
| Param | Type | Description |
| ------------- | ----------------------------- | --------------------------- |
| options | { key: string; } | - The trigger key to remove |
--------------------
`typescript`
removeTriggers(options: { keys: string[]; }) => Promise
Remove multiple triggers for in-app messages.
| Param | Type | Description |
| ------------- | -------------------------------- | ---------------------------- |
| options | { keys: string[]; } | - The trigger keys to remove |
--------------------
`typescript`
clearTriggers() => Promise
Clear all triggers for in-app messages.
--------------------
`typescript`
setInAppMessagesPaused(options: { paused: boolean; }) => Promise
Pause or resume in-app messages.
| Param | Type | Description |
| ------------- | --------------------------------- | ---------------------------------- |
| options | { paused: boolean; } | - Whether to pause in-app messages |
--------------------
`typescript`
getInAppMessagesPaused() => Promise<{ paused: boolean; }>
Check if in-app messages are paused.
Returns: Promise<{ paused: boolean; }>
--------------------
`typescript`
setLocationShared(options: { shared: boolean; }) => Promise
Set whether location sharing is enabled.
| Param | Type | Description |
| ------------- | --------------------------------- | ------------------------------------- |
| options | { shared: boolean; } | - Whether location sharing is enabled |
--------------------
`typescript`
getLocationShared() => Promise<{ shared: boolean; }>
Check if location sharing is enabled.
Returns: Promise<{ shared: boolean; }>
--------------------
`typescript`
requestLocationPermission() => Promise
Request location permission from the user.
--------------------
`typescript`
enterLiveActivity(options: { activityId: string; token: string; }) => Promise
Enter a live activity (iOS 16.1+ only).
| Param | Type | Description |
| ------------- | --------------------------------------------------- | --------------------------- |
| options | { activityId: string; token: string; } | - The activity ID and token |
--------------------
`typescript`
exitLiveActivity(options: { activityId: string; }) => Promise
Exit a live activity (iOS 16.1+ only).
| Param | Type | Description |
| ------------- | ------------------------------------ | ----------------- |
| options | { activityId: string; } | - The activity ID |
--------------------
`typescript`
setPushToStartToken(options: { activityType: string; token: string; }) => Promise
Set the push-to-start token for a live activity type (iOS 17.2+ only).
| Param | Type | Description |
| ------------- | ----------------------------------------------------- | ----------------------------- |
| options | { activityType: string; token: string; } | - The activity type and token |
--------------------
`typescript`
removePushToStartToken(options: { activityType: string; }) => Promise
Remove the push-to-start token for a live activity type (iOS 17.2+ only).
| Param | Type | Description |
| ------------- | -------------------------------------- | ------------------- |
| options | { activityType: string; } | - The activity type |
--------------------
`typescript`
addListener(eventName: 'notificationClicked', listenerFunc: (event: NotificationClickEvent) => void) => Promise
Listen for notification click events.
| Param | Type |
| ------------------ | --------------------------------------------------------------------------------------------- |
| eventName | 'notificationClicked' |
| listenerFunc | (event: NotificationClickEvent) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'notificationWillDisplay', listenerFunc: (event: NotificationWillDisplayEvent) => void) => Promise
Listen for notification foreground will display events.
Call event.notification.display() to display the notification.
| Param | Type |
| ------------------ | --------------------------------------------------------------------------------------------------------- |
| eventName | 'notificationWillDisplay' |
| listenerFunc | (event: NotificationWillDisplayEvent) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'permissionChanged', listenerFunc: (event: PermissionChangedState) => void) => Promise
Listen for permission changes.
| Param | Type |
| ------------------ | --------------------------------------------------------------------------------------------- |
| eventName | 'permissionChanged' |
| listenerFunc | (event: PermissionChangedState) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'pushSubscriptionChanged', listenerFunc: (event: PushSubscriptionChangedState) => void) => Promise
Listen for push subscription changes.
| Param | Type |
| ------------------ | --------------------------------------------------------------------------------------------------------- |
| eventName | 'pushSubscriptionChanged' |
| listenerFunc | (event: PushSubscriptionChangedState) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'userChanged', listenerFunc: (event: UserChangedState) => void) => Promise
Listen for user state changes.
| Param | Type |
| ------------------ | --------------------------------------------------------------------------------- |
| eventName | 'userChanged' |
| listenerFunc | (event: UserChangedState) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'inAppMessageClicked', listenerFunc: (event: InAppMessageClickEvent) => void) => Promise
Listen for in-app message click events.
| Param | Type |
| ------------------ | --------------------------------------------------------------------------------------------- |
| eventName | 'inAppMessageClicked' |
| listenerFunc | (event: InAppMessageClickEvent) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'inAppMessageWillDisplay', listenerFunc: (event: InAppMessageWillDisplayEvent) => void) => Promise
Listen for in-app message will display events.
| Param | Type |
| ------------------ | --------------------------------------------------------------------------------------------------------- |
| eventName | 'inAppMessageWillDisplay' |
| listenerFunc | (event: InAppMessageWillDisplayEvent) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'inAppMessageDidDisplay', listenerFunc: (event: InAppMessageDidDisplayEvent) => void) => Promise
Listen for in-app message did display events.
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------------------------------- |
| eventName | 'inAppMessageDidDisplay' |
| listenerFunc | (event: InAppMessageDidDisplayEvent) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'inAppMessageWillDismiss', listenerFunc: (event: InAppMessageWillDismissEvent) => void) => Promise
Listen for in-app message will dismiss events.
| Param | Type |
| ------------------ | --------------------------------------------------------------------------------------------------------- |
| eventName | 'inAppMessageWillDismiss' |
| listenerFunc | (event: InAppMessageWillDismissEvent) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
addListener(eventName: 'inAppMessageDidDismiss', listenerFunc: (event: InAppMessageDidDismissEvent) => void) => Promise
Listen for in-app message did dismiss events.
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------------------------------- |
| eventName | 'inAppMessageDidDismiss' |
| listenerFunc | (event: InAppMessageDidDismissEvent) => void |
Returns: Promise<PluginListenerHandle>
--------------------
`typescript`
removeAllListeners() => Promise
Remove all listeners for a specific event.
--------------------
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
#### NotificationClickEvent
| Prop | Type | Description |
| ------------------ | --------------------------------------------------------------------------- | --------------------------------- |
| notification | OSNotification | The notification that was clicked |
| result | NotificationClickResult | The result of the click action |
#### OSNotification
| Prop | Type | Description |
| --------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------ |
| body | string | The message body of the notification |
| title | string | The title of the notification |
| sound | string | The sound to play when the notification is received |
| launchURL | string | URL to launch when the notification is clicked |
| rawPayload | Record<string, unknown> | Raw payload from OneSignal |
| actionButtons | OSActionButton[] | Action buttons attached to the notification |
| additionalData | Record<string, unknown> | Custom additional data attached to the notification |
| notificationId | string | Unique identifier for the notification |
| groupKey | string | Android: Group key for notification grouping |
| groupMessage | string | Android: Summary text for grouped notifications |
| groupedNotifications | OSNotification[] | Android: Grouped notifications |
| ledColor | string | Android: LED color |
| priority | number | Android: Notification priority |
| smallIcon | string | Android: Small icon resource name |
| largeIcon | string | Android: Large icon URL or resource name |
| bigPicture | string | Android: Big picture URL |
| collapseId | string | Android: Collapse ID for notification replacement |
| fromProjectNumber | string | Android: Project number the notification was sent from |
| smallIconAccentColor | string | Android: Accent color for the small icon |
| lockScreenVisibility | number | Android: Lock screen visibility |
| androidNotificationId | number | Android: Notification ID (integer) |
| badge | number | iOS: Badge count |
| badgeIncrement | number | iOS: Badge increment |
| category | string | iOS: Notification category |
| threadId | string | iOS: Thread ID for notification grouping |
| subtitle | string | iOS: Subtitle text |
| templateId | string | iOS: Template ID |
| templateName | string | iOS: Template name |
| attachments | Record<string, string> | iOS: Media attachments |
| mutableContent | boolean | iOS: Whether content is mutable |
| contentAvailable | boolean | iOS: Whether content is available in background |
| relevanceScore | number | iOS: Relevance score for notification summary |
| interruptionLevel | string | iOS: Interruption level |
#### OSActionButton
| Prop | Type | Description |
| ---------- | ------------------- | --------------------------------- |
| id | string | Action button ID |
| text | string | Action button text |
| icon | string | Action button icon (Android only) |
#### NotificationClickResult
| Prop | Type | Description |
| -------------- | ------------------- | --------------------------------------------- |
| actionId | string | The action ID if an action button was clicked |
| url | string | The URL to open |
#### NotificationWillDisplayEvent
| Prop | Type | Description |
| ------------------ | --------------------------------------------------------- | -------------------------------- |
| notification | OSNotification | The notification to be displayed |
#### PermissionChangedState
| Prop | Type | Description |
| ---------------- | -------------------- | ----------------------------- |
| permission | boolean | Whether permission is granted |
#### PushSubscriptionChangedState
| Prop | Type | Description |
| -------------- | ----------------------------------------------------------------------- | ------------------------------- |
| previous | PushSubscriptionState | The previous subscription state |
| current | PushSubscriptionState | The current subscription state |
#### PushSubscriptionState
| Prop | Type | Description |
| ------------- | -------------------- | -------------------------------------------------- |
| id | string | The push subscription ID |
| token | string | The push token |
| optedIn | boolean | Whether the user is opted in to push notifications |
#### UserChangedState
| Prop | Type | Description |
| ------------- | ----------------------------------------------- | ---------------------- |
| current | UserState | The current user state |
#### UserState
| Prop | Type | Description |
| ----------------- | ------------------- | ------------------------------------ |
| onesignalId | string | The OneSignal user ID |
| externalId | string | The external user ID set via login() |
#### InAppMessageClickEvent
| Prop | Type | Description |
| ------------- | --------------------------------------------------------------------------- | ------------------ |
| message | OSInAppMessage | The in-app message |
| result | InAppMessageClickResult | The click result |
#### OSInAppMessage
| Prop | Type | Description |
| --------------- | ------------------- | ---------------------------------------- |
| messageId | string | Unique identifier for the in-app message |
#### InAppMessageClickResult
| Prop | Type | Description |
| -------------------- | ------------------------------------------------------------------------------- | --------------------------------------- |
| actionId | string | The action ID |
| url | string | The URL to open |
| urlTarget | InAppMessageActionUrlType | How to open the URL |
| closingMessage | boolean | Whether the in-app message should close |
#### InAppMessageWillDisplayEvent
| Prop | Type | Description |
| ------------- | --------------------------------------------------------- | ------------------ |
| message | OSInAppMessage | The in-app message |
#### InAppMessageDidDisplayEvent
| Prop | Type | Description |
| ------------- | --------------------------------------------------------- | ------------------ |
| message | OSInAppMessage | The in-app message |
#### InAppMessageWillDismissEvent
| Prop | Type | Description |
| ------------- | --------------------------------------------------------- | ------------------ |
| message | OSInAppMessage | The in-app message |
#### InAppMessageDidDismissEvent
| Prop | Type | Description |
| ------------- | --------------------------------------------------------- | ------------------ |
| message | OSInAppMessage | The in-app message |
#### Record
Construct a type with a set of properties K of type T
{
[P in K]: T;
}
#### LogLevel
| Members | Value |
| ------------- | -------------- |
| None | 0 |
| Fatal | 1 |
| Error | 2 |
| Warn | 3 |
| Info | 4 |
| Debug | 5 |
| Verbose | 6 |
#### OSNotificationPermission
| Members | Value |
| ------------------- | -------------- |
| NotDetermined | 0 |
| Denied | 1 |
| Authorized | 2 |
| Provisional | 3 |
| Ephemeral | 4 |
#### InAppMessageActionUrlType
| Members | Value |
| -------------------- | -------------- |
| InAppWebview | 0 |
| Browser | 1 |
| ReplaceContent` | 2 |