diff --git a/README.md b/README.md
index 5f0bc7e..c1a6ca8 100644
--- a/README.md
+++ b/README.md
@@ -106,13 +106,13 @@ See the `examples/demo` directory for a full working example.
-- [`initialize(...)`](#initialize)
-- [`login(...)`](#login)
-- [`logout()`](#logout)
-- [`setConsentRequired(...)`](#setconsentrequired)
-- [`setConsentGiven(...)`](#setconsentgiven)
-- [Interfaces](#interfaces)
-- [Type Aliases](#type-aliases)
+* [`initialize(...)`](#initialize)
+* [`login(...)`](#login)
+* [`logout()`](#logout)
+* [`setConsentRequired(...)`](#setconsentrequired)
+* [`setConsentGiven(...)`](#setconsentgiven)
+* [Interfaces](#interfaces)
+* [Type Aliases](#type-aliases)
@@ -133,7 +133,8 @@ Initialize the SDK with your OneSignal app ID. Call during app startup.
| ----------- | ------------------- |
| **`appId`** | string |
----
+--------------------
+
### login(...)
@@ -147,7 +148,8 @@ Log in to OneSignal as the user identified by `externalId`, switching the user c
| ---------------- | ------------------- |
| **`externalId`** | string |
----
+--------------------
+
### logout()
@@ -157,7 +159,8 @@ logout() => Promise
Log out the current user. The SDK will reference a new device-scoped user.
----
+--------------------
+
### setConsentRequired(...)
@@ -171,7 +174,8 @@ Set whether user privacy consent is required before sending data to OneSignal. C
| -------------- | -------------------- |
| **`required`** | boolean |
----
+--------------------
+
### setConsentGiven(...)
@@ -185,10 +189,12 @@ Indicate whether the user has granted privacy consent.
| ------------- | -------------------- |
| **`granted`** | boolean |
----
+--------------------
+
### Interfaces
+
#### OneSignalDebugAPI
Debug helpers exposed via `OneSignal.Debug`.
@@ -198,6 +204,7 @@ Debug helpers exposed via `OneSignal.Debug`.
| **setLogLevel** | (logLevel: LogLevel) => void | Set the log level printed to LogCat (Android) or the Xcode console (iOS). |
| **setAlertLevel** | (visualLogLevel: LogLevel) => void | Set the log level shown to the user as alert dialogs. |
+
#### OneSignalUserAPI
Current-user operations exposed via `OneSignal.User`.
@@ -228,12 +235,14 @@ Current-user operations exposed via `OneSignal.User`.
| **getExternalId** | () => Promise<string \| null> | Get the external ID set via `login`, or null if the user is anonymous. |
| **trackEvent** | (name: string, properties?: object \| undefined) => Promise<void> | Track a custom event with an optional set of JSON-serializable properties. |
+
#### UserChangedState
| Prop | Type |
| ------------- | ----------------------------------------------- |
| **`current`** | UserState |
+
#### UserState
| Prop | Type |
@@ -241,6 +250,7 @@ Current-user operations exposed via `OneSignal.User`.
| **`onesignalId`** | string |
| **`externalId`** | string |
+
#### OneSignalPushSubscriptionAPI
Push subscription state and controls exposed via `OneSignal.User.pushSubscription`.
@@ -255,6 +265,7 @@ Push subscription state and controls exposed via `OneSignal.User.pushSubscriptio
| **optIn** | () => Promise<void> | Opt the user in to push notifications. Prompts for permission if needed. |
| **optOut** | () => Promise<void> | Opt the user out of push notifications on this device. |
+
#### PushSubscriptionChangedState
| Prop | Type |
@@ -262,6 +273,7 @@ Push subscription state and controls exposed via `OneSignal.User.pushSubscriptio
| **`previous`** | PushSubscriptionState |
| **`current`** | PushSubscriptionState |
+
#### PushSubscriptionState
| Prop | Type |
@@ -270,6 +282,7 @@ Push subscription state and controls exposed via `OneSignal.User.pushSubscriptio
| **`token`** | string |
| **`optedIn`** | boolean |
+
#### OneSignalNotificationsAPI
Notification permission and event handling exposed via `OneSignal.Notifications`.
@@ -287,6 +300,7 @@ Notification permission and event handling exposed via `OneSignal.Notifications`
| **removeNotification** | (id: number) => Promise<void> | Android only. Cancel a single notification by its Android notification ID. |
| **removeGroupedNotifications** | (id: string) => Promise<void> | Android only. Cancel a group of notifications by group key. |
+
#### NotificationClickEvent
| Prop | Type |
@@ -294,6 +308,7 @@ Notification permission and event handling exposed via `OneSignal.Notifications`
| **`result`** | NotificationClickResult |
| **`notification`** | OSNotification |
+
#### NotificationClickResult
| Prop | Type |
@@ -301,6 +316,7 @@ Notification permission and event handling exposed via `OneSignal.Notifications`
| **`actionId`** | string |
| **`url`** | string |
+
#### OneSignalInAppMessagesAPI
In-app message triggers and event handling exposed via `OneSignal.InAppMessages`.
@@ -317,6 +333,7 @@ In-app message triggers and event handling exposed via `OneSignal.InAppMessages`
| **setPaused** | (pause: boolean) => void | Pause or resume the display of in-app messages. |
| **getPaused** | () => Promise<boolean> | Whether in-app messaging is currently paused. |
+
#### InAppMessageClickEvent
| Prop | Type |
@@ -324,12 +341,14 @@ In-app message triggers and event handling exposed via `OneSignal.InAppMessages`
| **`message`** | OSInAppMessage |
| **`result`** | InAppMessageClickResult |
+
#### OSInAppMessage
| Prop | Type |
| --------------- | ------------------- |
| **`messageId`** | string |
+
#### InAppMessageClickResult
| Prop | Type |
@@ -339,30 +358,35 @@ In-app message triggers and event handling exposed via `OneSignal.InAppMessages`
| **`url`** | string |
| **`urlTarget`** | InAppMessageActionUrlType |
+
#### InAppMessageWillDisplayEvent
| Prop | Type |
| ------------- | --------------------------------------------------------- |
| **`message`** | OSInAppMessage |
+
#### InAppMessageDidDisplayEvent
| Prop | Type |
| ------------- | --------------------------------------------------------- |
| **`message`** | OSInAppMessage |
+
#### InAppMessageWillDismissEvent
| Prop | Type |
| ------------- | --------------------------------------------------------- |
| **`message`** | OSInAppMessage |
+
#### InAppMessageDidDismissEvent
| Prop | Type |
| ------------- | --------------------------------------------------------- |
| **`message`** | OSInAppMessage |
+
#### OneSignalSessionAPI
Outcome reporting exposed via `OneSignal.Session`.
@@ -373,6 +397,7 @@ Outcome reporting exposed via `OneSignal.Session`.
| **addUniqueOutcome** | (name: string) => Promise<void> | Record a unique outcome with the given name against the current session. |
| **addOutcomeWithValue** | (name: string, value: number) => Promise<void> | Record an outcome with the given name and value against the current session. |
+
#### OneSignalLocationAPI
Location permission and sharing exposed via `OneSignal.Location`.
@@ -383,6 +408,7 @@ Location permission and sharing exposed via `OneSignal.Location`.
| **setShared** | (shared: boolean) => void | Enable or disable sharing the device location with OneSignal. |
| **isShared** | () => Promise<boolean> | Whether the device location is currently shared with OneSignal. |
+
#### OneSignalLiveActivitiesAPI
Live activity controls exposed via `OneSignal.LiveActivities`. iOS only unless noted.
@@ -396,48 +422,56 @@ Live activity controls exposed via `OneSignal.LiveActivities`. iOS only unless n
| **setupDefault** | (options?: LiveActivitySetupOptions \| undefined) => Promise<void> | Set up the OneSignal default live activity, optionally enabling pushToStart/pushToUpdate. |
| **startDefault** | (activityId: string, attributes: Record<string, unknown>, content: Record<string, unknown>) => Promise<void> | Start a live activity backed by the OneSignal default attributes type. |
+
### Type Aliases
+
#### LogLevel
(typeof LogLevel)[keyof typeof LogLevel]
+
#### Record
Construct a type with a set of properties K of type T
-{
-[P in K]: T;
-}
+{
[P in K]: T;
}
+
#### OSNotificationPermission
(typeof OSNotificationPermission)[keyof typeof OSNotificationPermission]
+
#### NotificationEventName
'click' | 'foregroundWillDisplay' | 'permissionChange'
+
#### NotificationEventTypeMap
{ click: NotificationClickEvent; foregroundWillDisplay: NotificationWillDisplayEvent; permissionChange: boolean; }
+
#### InAppMessageEventName
'click' | 'willDisplay' | 'didDisplay' | 'willDismiss' | 'didDismiss'
+
#### InAppMessageEventTypeMap
{ click: InAppMessageClickEvent; willDisplay: InAppMessageWillDisplayEvent; didDisplay: InAppMessageDidDisplayEvent; willDismiss: InAppMessageWillDismissEvent; didDismiss: InAppMessageDidDismissEvent; }
+
#### InAppMessageActionUrlType
'browser' | 'webview' | 'replacement'
+
#### LiveActivitySetupOptions
The setup options for `OneSignal.LiveActivities.setupDefault`.
-{ /** _ When true, OneSignal will listen for pushToStart tokens for the `OneSignalLiveActivityAttributes` structure. _/ enablePushToStart: boolean; /** _ When true, OneSignal will listen for pushToUpdate tokens for each start live activity that uses the _ `OneSignalLiveActivityAttributes` structure. \*/ enablePushToUpdate: boolean; }
+{ /** * When true, OneSignal will listen for pushToStart tokens for the `OneSignalLiveActivityAttributes` structure. */ enablePushToStart: boolean; /** * When true, OneSignal will listen for pushToUpdate tokens for each start live activity that uses the * `OneSignalLiveActivityAttributes` structure. */ enablePushToUpdate: boolean; }
diff --git a/android/src/main/kotlin/com/onesignal/capacitor/OneSignalCapacitorPlugin.kt b/android/src/main/kotlin/com/onesignal/capacitor/OneSignalCapacitorPlugin.kt
index d891e63..c29ce4a 100644
--- a/android/src/main/kotlin/com/onesignal/capacitor/OneSignalCapacitorPlugin.kt
+++ b/android/src/main/kotlin/com/onesignal/capacitor/OneSignalCapacitorPlugin.kt
@@ -140,7 +140,7 @@ class OneSignalCapacitorPlugin : Plugin(),
initialized = true
OneSignalWrapper.sdkType = "capacitor"
- OneSignalWrapper.sdkVersion = "010006"
+ OneSignalWrapper.sdkVersion = "010100"
OneSignal.initWithContext(context, appId)
OneSignal.Notifications.addPermissionObserver(permissionObserver)
diff --git a/examples/demo-no-location/setup.sh b/examples/demo-no-location/setup.sh
index 42a194b..a1c180d 100755
--- a/examples/demo-no-location/setup.sh
+++ b/examples/demo-no-location/setup.sh
@@ -12,7 +12,7 @@ info "Packing local Capacitor plugin..."
(cd "$SDK_ROOT" && rm -f onesignal-capacitor-plugin*.tgz && bun pm pack --filename onesignal-capacitor-plugin.tgz >/dev/null)
info "Installing demo dependencies..."
-(cd "$DEMO_DIR" && bun install)
+(cd "$DEMO_DIR" && bun update @onesignal/capacitor-plugin && bun install)
info "Building web bundle..."
(cd "$DEMO_DIR" && vp build)
diff --git a/ios/Sources/OneSignalCapacitorPlugin/OneSignalCapacitorPlugin.swift b/ios/Sources/OneSignalCapacitorPlugin/OneSignalCapacitorPlugin.swift
index fcae0c2..9b47734 100644
--- a/ios/Sources/OneSignalCapacitorPlugin/OneSignalCapacitorPlugin.swift
+++ b/ios/Sources/OneSignalCapacitorPlugin/OneSignalCapacitorPlugin.swift
@@ -110,7 +110,7 @@ public class OneSignalCapacitorPlugin: CAPPlugin, CAPBridgedPlugin {
initialized = true
OneSignalWrapper.sdkType = "capacitor"
- OneSignalWrapper.sdkVersion = "010006"
+ OneSignalWrapper.sdkVersion = "010100"
// OSCapacitorLaunchOptions's +load captures the dictionary from
// UIApplicationDidFinishLaunchingNotification at process start (before
// main()), so cold-start notification taps that arrive via launchOptions
diff --git a/package.json b/package.json
index b87760f..a5db6fb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@onesignal/capacitor-plugin",
- "version": "1.0.6",
+ "version": "1.1.0",
"description": "OneSignal is a high volume Push Notification service for mobile apps. This is the pure Capacitor plugin for OneSignal, providing push notifications, in-app messaging, and more.",
"keywords": [
"apns",