@allboatsrise/expo-marketingcloudsdk 48.0.0 → 48.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +111 -1
- package/android/build.gradle +3 -3
- package/android/src/main/AndroidManifest.xml +0 -0
- package/android/src/main/java/expo/modules/marketingcloudsdk/ExpoMarketingCloudSdkModule.kt +0 -0
- package/android/src/main/java/expo/modules/marketingcloudsdk/ExpoMarketingCloudSdkPackage.kt +0 -0
- package/android/src/main/java/expo/modules/marketingcloudsdk/ExpoMarketingCloudSdkReactActivityLifecycleListener.kt +0 -0
- package/android/src/main/java/expo/modules/marketingcloudsdk/service/ExpoFirebaseMessagingService.kt +0 -0
- package/android/src/main/res/drawable/notification_icon.png +0 -0
- package/android/src/main/res/values/strings.xml +0 -0
- package/app.plugin.js +0 -0
- package/build/ExpoMarketingCloudSdk.types.d.ts +0 -0
- package/build/ExpoMarketingCloudSdk.types.d.ts.map +0 -0
- package/build/ExpoMarketingCloudSdk.types.js +0 -0
- package/build/ExpoMarketingCloudSdk.types.js.map +0 -0
- package/build/ExpoMarketingCloudSdkModule.d.ts +0 -0
- package/build/ExpoMarketingCloudSdkModule.d.ts.map +0 -0
- package/build/ExpoMarketingCloudSdkModule.js +0 -0
- package/build/ExpoMarketingCloudSdkModule.js.map +0 -0
- package/build/index.d.ts +0 -0
- package/build/index.d.ts.map +0 -0
- package/build/index.js +0 -0
- package/build/index.js.map +0 -0
- package/expo-module.config.json +0 -0
- package/ios/ExpoMarketingCloudSdk-Bridging-Header.h +0 -0
- package/ios/ExpoMarketingCloudSdk.podspec +2 -1
- package/ios/ExpoMarketingCloudSdkAppDelegateSubscriber.swift +0 -0
- package/ios/ExpoMarketingCloudSdkDeviceToken.swift +0 -0
- package/ios/ExpoMarketingCloudSdkLogger.swift +0 -0
- package/ios/ExpoMarketingCloudSdkModule.swift +0 -0
- package/ios/ExpoMarketingCloudSdkNotificationsDelegate.swift +0 -0
- package/package.json +1 -1
- package/plugin/build/android/index.d.ts +0 -0
- package/plugin/build/android/index.js +1 -1
- package/plugin/build/index.d.ts +0 -0
- package/plugin/build/index.js +0 -0
- package/plugin/build/ios/index.d.ts +0 -0
- package/plugin/build/ios/index.js +0 -0
- package/plugin/build/types.d.ts +0 -0
- package/plugin/build/types.js +0 -0
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -1,3 +1,113 @@
|
|
|
1
1
|
# @allboatsrise/expo-marketingcloudsdk
|
|
2
2
|
|
|
3
|
-
Expo module
|
|
3
|
+
This is an Expo module that provides a wrapper around the Salesforce Marketing Cloud SDK for iOS and Android.
|
|
4
|
+
|
|
5
|
+
It allows Expo-based apps to integrate with the Marketing Cloud SDK.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
To install the package use your prefered package manager:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @allboatsrise/expo-marketingcloudsdk expo-notifications
|
|
13
|
+
```
|
|
14
|
+
or
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @allboatsrise/expo-marketingcloudsdk expo-notifications
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Plugin setup
|
|
20
|
+
#### [View parameters](#plugin-parameters)
|
|
21
|
+
|
|
22
|
+
Add package to `plugins` in `app.js`/`app.config.js`.
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
"expo": {
|
|
26
|
+
"plugins": [
|
|
27
|
+
[
|
|
28
|
+
"@allboatsrise/expo-marketingcloudsdk", {
|
|
29
|
+
"appId": "<< MARKETING_CLOUD_APP_ID >>",
|
|
30
|
+
"accessToken": "<< MARKETING_CLOUD_ACCESS_TOKEN >>",
|
|
31
|
+
"serverUrl": "<< MARKETING_CLOUD_SERVER_URL >>",
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"expo-notifications",
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Plugin parameters
|
|
40
|
+
|
|
41
|
+
| Parameter | Type | Required | Description |
|
|
42
|
+
| --------------------------------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `appId` | string | Yes | Marketing Cloud app id |
|
|
44
|
+
| `accessToken` | string | Yes | Marketing Cloud access token |
|
|
45
|
+
| `serverUrl` | string | Yes | Marketing Cloud server url |
|
|
46
|
+
| `senderId` (Android only) | string | No | Marketing Cloud FCM sender id. Defaults to `project_info.project_number` defined in `android.googleServicesFile` (google-services.json) if defined. |
|
|
47
|
+
| `mid` | string | No | Sets the configuration value to use for the Salesforce MarketingCloud Tenant Specific mid. |
|
|
48
|
+
| `inboxEnabled` | boolean | No | Sets the configuration flag that enables or disables inbox services |
|
|
49
|
+
| `locationEnabled` | boolean | No | Sets the configuration flag that enables or disables location services |
|
|
50
|
+
| `analyticsEnabled` | boolean | No | Sets the configuration flag that enables or disables Salesforce MarketingCloud Analytics services |
|
|
51
|
+
| `applicationControlsBadging` | boolean | No | Sets the configuration value which enables or disables application control over badging |
|
|
52
|
+
| `delayRegistrationUntilContactKeyIsSet` | boolean | No | Sets the configuration value which enables or disables application control over delaying SDK registration until a contact key is set |
|
|
53
|
+
| `markNotificationReadOnInboxNotificationOpen` | boolean | No | Sets the configuration value which enables or disables marking inbox notifications as read on open (Android only) |
|
|
54
|
+
|
|
55
|
+
# Usage
|
|
56
|
+
|
|
57
|
+
Various functions, their parameters, return values, and their specific purposes in `ExpoMarketingCloudSdk`
|
|
58
|
+
|
|
59
|
+
## Functions
|
|
60
|
+
|
|
61
|
+
| Function Name | Parameters | Return Type | Description |
|
|
62
|
+
| --- | --- | --- | --- |
|
|
63
|
+
| `isPushEnabled` | None | `Promise<boolean>` | Returns a promise that resolves to a boolean indicating whether push notifications are enabled for the user. |
|
|
64
|
+
| `enablePush` | None | `Promise<void>` | Returns a promise that resolves when push notifications have been successfully enabled. |
|
|
65
|
+
| `disablePush` | None | `Promise<void>` | Returns a promise that resolves when push notifications have been successfully disabled. |
|
|
66
|
+
| `getSystemToken` | None | `Promise<string>` | Returns a promise that resolves to a string representing the device's push notification token. |
|
|
67
|
+
| `setSystemToken` | `token: string` | `Promise<void>` | Returns a promise that resolves when the device's push notification token has been successfully set. |
|
|
68
|
+
| `getAttributes` | None | `Promise<Record<string, string>>` | Returns a promise that resolves to an object representing the user's attributes. |
|
|
69
|
+
| `setAttribute` | `key: string`, `value: string` | `Promise<void>` | Returns a promise that resolves when an attribute has been successfully set for the user. |
|
|
70
|
+
| `clearAttribute` | `key: string` | `Promise<void>` | Returns a promise that resolves when an attribute has been successfully cleared for the user. |
|
|
71
|
+
| `addTag` | `tag: string` | `Promise<void>` | Returns a promise that resolves when a tag has been successfully added for the user. |
|
|
72
|
+
| `removeTag` | `tag: string` | `Promise<void>` | Returns a promise that resolves when a tag has been successfully removed for the user. |
|
|
73
|
+
| `getTags` | None | `Promise<string[]>` | Returns a promise that resolves to an array of strings representing the user's tags. |
|
|
74
|
+
| `setContactKey` | `contactKey: string` | `Promise<void>` | Returns a promise that resolves when the user's contact key has been successfully set. |
|
|
75
|
+
| `getContactKey` | None | `Promise<string>` | Returns a promise that resolves to a string representing the user's contact key. |
|
|
76
|
+
| `getSdkState` | None | `Promise<Record<string, unknown>>` | Returns a promise that resolves to an object representing the current state of the SDK. |
|
|
77
|
+
| `track` | `name: string`, `attributes: Record<string, string>` | `Promise<void>` | Returns a promise that resolves when a custom event has been successfully tracked. |
|
|
78
|
+
| `deleteMessage` | `messageId: string` | `Promise<void>` | Returns a promise that resolves when a specific inbox message has been successfully deleted. |
|
|
79
|
+
| `getDeletedMessageCount` | None | `Promise<number>` | Returns a promise that resolves to a number representing the total number of deleted inbox messages. |
|
|
80
|
+
| `getDeletedMessages` | None | `Promise<InboxMessage[]>` | Returns a promise that resolves to an array of `InboxMessage` objects representing the deleted inbox messages. |
|
|
81
|
+
| `getMessageCount` | None | `Promise<number>` | Returns a promise that resolves to a number representing the total number of inbox messages. |
|
|
82
|
+
| `getMessages` | None | `Promise<InboxMessage[]>` | Returns a promise that resolves to an array of `InboxMessage` objects representing the inbox messages. |
|
|
83
|
+
| `getReadMessageCount` | None | `Promise<number>` | Returns a promise that resolves to a number representing the total number of read inbox messages. |
|
|
84
|
+
| `getReadMessages` | None | `Promise<InboxMessage[]>` | Returns a promise that resolves to an array of `InboxMessage` objects representing the read inbox messages. |
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## Add event listener
|
|
88
|
+
Available event listeners:
|
|
89
|
+
|
|
90
|
+
| Function | Parameters | Description |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| `addLogListener` | `listener: (event: LogEventPayload) => void` | Adds a listener function to the `onLog` event, which is triggered when a new log event is generated. The function should take an argument of type `LogEventPayload`, which contains information about the log event. Returns a `Subscription` object that can be used to unsubscribe the listener. |
|
|
93
|
+
| `addInboxResponseListener` | `listener: (event: InboxResponsePayload) => void` | Adds a listener function to the `onInboxResponse` event, which is triggered when a new inbox response is received. The function should take an argument of type `InboxResponsePayload`, which contains information about the inbox response. Returns a `Subscription` object that can be used to unsubscribe the listener. |
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
// listeners being used in a useEffect hook.
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const logSubscription = addLogListener((logEvent: LogEventPayload) => {
|
|
100
|
+
// Do something with logEvent
|
|
101
|
+
})
|
|
102
|
+
const inboxSubscription = addInboxResponseListener((inboxEvent: InboxMessage[]) => {
|
|
103
|
+
// Do something with inboxEvent
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
return () => {
|
|
107
|
+
logSubscription.remove()
|
|
108
|
+
inboxSubscription.remove()
|
|
109
|
+
}
|
|
110
|
+
}, [])
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'expo.modules.marketingcloudsdk'
|
|
6
|
-
version = '
|
|
6
|
+
version = '48.0.2'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -77,7 +77,7 @@ android {
|
|
|
77
77
|
minSdkVersion safeExtGet("minSdkVersion", 21)
|
|
78
78
|
targetSdkVersion safeExtGet("targetSdkVersion", 31)
|
|
79
79
|
versionCode 1
|
|
80
|
-
versionName "
|
|
80
|
+
versionName "48.0.2"
|
|
81
81
|
}
|
|
82
82
|
lintOptions {
|
|
83
83
|
abortOnError false
|
|
@@ -94,5 +94,5 @@ dependencies {
|
|
|
94
94
|
implementation project(":expo-notifications")
|
|
95
95
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${getKotlinVersion()}"
|
|
96
96
|
implementation 'com.facebook.react:react-native:+'
|
|
97
|
-
api "com.salesforce.marketingcloud:marketingcloudsdk:8.0.
|
|
97
|
+
api "com.salesforce.marketingcloud:marketingcloudsdk:8.0.9"
|
|
98
98
|
}
|
|
File without changes
|
|
File without changes
|
package/android/src/main/java/expo/modules/marketingcloudsdk/ExpoMarketingCloudSdkPackage.kt
CHANGED
|
File without changes
|
|
File without changes
|
package/android/src/main/java/expo/modules/marketingcloudsdk/service/ExpoFirebaseMessagingService.kt
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/app.plugin.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/build/index.d.ts
CHANGED
|
File without changes
|
package/build/index.d.ts.map
CHANGED
|
File without changes
|
package/build/index.js
CHANGED
|
File without changes
|
package/build/index.js.map
CHANGED
|
File without changes
|
package/expo-module.config.json
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -16,7 +16,8 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.static_framework = true
|
|
17
17
|
|
|
18
18
|
s.dependency 'ExpoModulesCore'
|
|
19
|
-
s.dependency '
|
|
19
|
+
s.dependency 'EXNotifications'
|
|
20
|
+
s.dependency 'MarketingCloudSDK', '8.0.13'
|
|
20
21
|
|
|
21
22
|
# Swift/Objective-C compatibility
|
|
22
23
|
s.pod_target_xcconfig = {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allboatsrise/expo-marketingcloudsdk",
|
|
3
3
|
"author": "All Boats Rise Inc.",
|
|
4
|
-
"version": "48.0.
|
|
4
|
+
"version": "48.0.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Expo module for Salesforce Marketing Cloud SDK",
|
|
7
7
|
"homepage": "https://github.com/allboatsrise/expo-marketingcloudsdk",
|
|
File without changes
|
|
@@ -26,7 +26,7 @@ const withConfigureRepository = (config) => {
|
|
|
26
26
|
return (0, config_plugins_1.withAppBuildGradle)(config, async (config) => {
|
|
27
27
|
config.modResults.contents = (0, generateCode_1.mergeContents)({
|
|
28
28
|
src: config.modResults.contents,
|
|
29
|
-
newSrc: ` implementation 'com.salesforce.marketingcloud:marketingcloudsdk:8.0.
|
|
29
|
+
newSrc: ` implementation 'com.salesforce.marketingcloud:marketingcloudsdk:8.0.9'`,
|
|
30
30
|
anchor: /dependencies\s?{/,
|
|
31
31
|
offset: 1,
|
|
32
32
|
tag: '@allboatsrise/expo-marketingcloudsdk(maven:dependencies)',
|
package/plugin/build/index.d.ts
CHANGED
|
File without changes
|
package/plugin/build/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/plugin/build/types.d.ts
CHANGED
|
File without changes
|
package/plugin/build/types.js
CHANGED
|
File without changes
|