Skip to content

Commit bd67f5a

Browse files
authored
Merge pull request #132 from Iterable/next-version
[MOB-2798] RN SDK release
2 parents 1a45481 + 238b2c8 commit bd67f5a

File tree

12 files changed

+289
-282
lines changed

12 files changed

+289
-282
lines changed

Iterable-React-Native-SDK.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ Pod::Spec.new do |s|
2424

2525
s.swift_version = '5.3'
2626

27-
s.dependency 'Iterable-iOS-SDK', '~> 6.2.21'
27+
s.dependency 'Iterable-iOS-SDK', '~> 6.2.22'
2828
s.dependency 'React-Core'
2929
end

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ def getModuleVersion() {
2222

2323
dependencies {
2424
implementation 'com.facebook.react:react-native:+'
25-
api 'com.github.Iterable.iterable-android-sdk:iterableapi:3.2.12'
25+
api 'com.github.Iterable.iterable-android-sdk:iterableapi:3.2.13'
2626
}

android/src/main/java/com/iterable/reactnative/Serialization.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,6 @@ static IterableConfig.Builder getConfigFromReadableMap(ReadableMap iterableConte
128128
configBuilder.setAutoPushRegistration(iterableContextJSON.optBoolean("autoPushRegistration"));
129129
}
130130

131-
if (iterableContextJSON.has("checkForDeferredDeeplink")) {
132-
configBuilder.setCheckForDeferredDeeplink(iterableContextJSON.optBoolean("checkForDeferredDeeplink"));
133-
}
134-
135131
if (iterableContextJSON.has("inAppDisplayInterval")) {
136132
configBuilder.setInAppDisplayInterval(iterableContextJSON.optDouble("inAppDisplayInterval"));
137133
}

ios/RNIterableAPI/RNIterableAPI.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ @interface RCT_EXTERN_REMAP_MODULE(RNIterableAPI, ReactIterableAPI, NSObject)
1717
RCT_EXTERN_METHOD(initialize2WithApiKey: (nonnull NSString *) apiKey
1818
config: (nonnull NSDictionary *) config
1919
apiEndPointOverride: (nonnull NSString *) apiEndPoint
20-
linksEndPointOverride: (nonnull NSString *) linksEndPoint
2120
version: (nonnull NSString *) version
2221
resolver: (RCTPromiseResolveBlock) resolve
2322
rejecter: (RCTPromiseRejectBlock) reject)

ios/RNIterableAPI/ReactIterableAPI.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,11 @@ class ReactIterableAPI: RCTEventEmitter {
6565
rejecter: rejecter)
6666
}
6767

68-
@objc(initialize2WithApiKey:config:apiEndPointOverride:linksEndPointOverride:version:resolver:rejecter:)
68+
@objc(initialize2WithApiKey:config:apiEndPointOverride:version:resolver:rejecter:)
6969
func initialize2(apiKey: String,
7070
config configDict: [AnyHashable: Any],
7171
version: String,
7272
apiEndPointOverride: String,
73-
linksEndPointOverride: String,
7473
resolver: @escaping RCTPromiseResolveBlock,
7574
rejecter: @escaping RCTPromiseRejectBlock) {
7675
ITBInfo()
@@ -79,7 +78,6 @@ class ReactIterableAPI: RCTEventEmitter {
7978
config: configDict,
8079
version: version,
8180
apiEndPointOverride: apiEndPointOverride,
82-
linksEndPointOverride: linksEndPointOverride,
8381
resolver: resolver,
8482
rejecter: rejecter)
8583
}
@@ -421,7 +419,6 @@ class ReactIterableAPI: RCTEventEmitter {
421419
config configDict: [AnyHashable: Any],
422420
version: String,
423421
apiEndPointOverride: String? = nil,
424-
linksEndPointOverride: String? = nil,
425422
resolver: @escaping RCTPromiseResolveBlock,
426423
rejecter: @escaping RCTPromiseRejectBlock) {
427424
ITBInfo()
@@ -448,8 +445,7 @@ class ReactIterableAPI: RCTEventEmitter {
448445
IterableAPI.initialize2(apiKey: apiKey,
449446
launchOptions: launchOptions,
450447
config: iterableConfig,
451-
apiEndPointOverride: apiEndPointOverride,
452-
linksEndPointOverride: linksEndPointOverride) { result in
448+
apiEndPointOverride: apiEndPointOverride) { result in
453449
resolver(result)
454450
}
455451
IterableAPI.setDeviceAttribute(name: "reactNativeSDKVersion", value: version)

ios/RNIterableAPI/Serialization.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ extension IterableConfig {
5151
config.autoPushRegistration = autoPushRegistration
5252
}
5353

54-
if let checkForDeferredDeeplink = dict["checkForDeferredDeeplink"] as? Bool {
55-
config.checkForDeferredDeeplink = checkForDeferredDeeplink
56-
}
57-
5854
if let inAppDisplayInterval = dict["inAppDisplayInterval"] as? Double {
5955
config.inAppDisplayInterval = inAppDisplayInterval
6056
}
@@ -134,6 +130,7 @@ extension IterableInAppMessage {
134130
dict["inboxMetadata"] = inboxMetadata?.toDict() ?? nil
135131
dict["customPayload"] = customPayload
136132
dict["read"] = read
133+
dict["priorityLevel"] = priorityLevel
137134
return dict
138135
}
139136
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@iterable/react-native-sdk",
3-
"version": "1.0.26",
3+
"version": "1.0.27",
44
"description": "Iterable SDK for React Native.",
55
"main": "./js/index.js",
66
"types": "./js/index.d.ts",

ts/Iterable.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class IterableConfig {
4949

5050
/**
5151
* When set to true, it will check for deferred deep links on first time app launch after installation from the App Store.
52+
* This is currently deprecated and will be removed in the future.
5253
*/
5354
checkForDeferredDeeplink = false
5455

@@ -94,7 +95,6 @@ class IterableConfig {
9495
return {
9596
"pushIntegrationName": this.pushIntegrationName,
9697
"autoPushRegistration": this.autoPushRegistration,
97-
"checkForDeferredDeeplink": this.checkForDeferredDeeplink,
9898
"inAppDisplayInterval": this.inAppDisplayInterval,
9999
"urlHandlerPresent": this.urlHandler != undefined,
100100
"customActionHandlerPresent": this.customActionHandler != undefined,
@@ -199,13 +199,13 @@ class Iterable {
199199
* DO NOT CALL THIS METHOD.
200200
* This method is used internally to connect to staging environment.
201201
*/
202-
static initialize2(apiKey: string, config: IterableConfig = new IterableConfig(), apiEndPoint: string, linksEndPoint: string): Promise<boolean> {
202+
static initialize2(apiKey: string, config: IterableConfig = new IterableConfig(), apiEndPoint: string): Promise<boolean> {
203203
console.log("initialize2: " + apiKey);
204204

205205
this.setupEventHandlers(config)
206206
const version = this.getVersionFromPackageJson()
207207

208-
return RNIterableAPI.initialize2WithApiKey(apiKey, config.toDict(), version, apiEndPoint, linksEndPoint)
208+
return RNIterableAPI.initialize2WithApiKey(apiKey, config.toDict(), version, apiEndPoint)
209209
}
210210

211211
/**

ts/IterableInAppClasses.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ class IterableInAppMessage {
155155
* Whether this inbox message has been read
156156
*/
157157
readonly read: boolean
158+
/**
159+
* the priority value this in-app message has
160+
*/
161+
readonly priorityLevel: number
158162

159163
constructor(messageId: string,
160164
campaignId: number,
@@ -164,7 +168,8 @@ class IterableInAppMessage {
164168
saveToInbox: boolean,
165169
inboxMetadata: IterableInboxMetadata | undefined,
166170
customPayload: any | undefined,
167-
read: boolean) {
171+
read: boolean,
172+
priorityLevel: number) {
168173
this.campaignId = campaignId
169174
this.messageId = messageId
170175
this.trigger = trigger
@@ -174,6 +179,7 @@ class IterableInAppMessage {
174179
this.inboxMetadata = inboxMetadata
175180
this.customPayload = customPayload
176181
this.read = read
182+
this.priorityLevel = priorityLevel
177183
}
178184

179185
isSilentInbox(): boolean {
@@ -186,11 +192,13 @@ class IterableInAppMessage {
186192
const trigger = IterableInAppTrigger.fromDict(dict["trigger"])
187193
let createdAt = dict["createdAt"]
188194
if (createdAt) {
189-
createdAt = new Date(createdAt as number)
195+
var dateObject = new Date(0)
196+
createdAt = dateObject.setUTCMilliseconds(createdAt)
190197
}
191198
let expiresAt = dict["expiresAt"]
192199
if (expiresAt) {
193-
expiresAt = new Date(expiresAt as number)
200+
var dateObject = new Date(0)
201+
expiresAt = dateObject.setUTCMilliseconds(expiresAt)
194202
}
195203
let saveToInbox = IterableUtil.readBoolean(dict, "saveToInbox")
196204
let inboxMetadataDict = dict["inboxMetadata"]
@@ -203,6 +211,8 @@ class IterableInAppMessage {
203211
let customPayload = dict["customPayload"]
204212
let read = IterableUtil.readBoolean(dict, "read")
205213

214+
let priorityLevel = dict["priorityLevel"] as number
215+
206216
return new IterableInAppMessage(
207217
messageId,
208218
campaignId,
@@ -212,7 +222,8 @@ class IterableInAppMessage {
212222
saveToInbox,
213223
inboxMetadata,
214224
customPayload,
215-
read
225+
read,
226+
priorityLevel
216227
)
217228
}
218229

ts/__tests__/Iterable.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ test("default config values", () => {
118118

119119
expect(config.pushIntegrationName).toBe(undefined)
120120
expect(config.autoPushRegistration).toBe(true)
121-
expect(config.checkForDeferredDeeplink).toBe(false)
122121
expect(config.inAppDisplayInterval).toBe(30.0)
123122
expect(config.urlHandler).toBe(undefined)
124123
expect(config.customActionHandler).toBe(undefined)
@@ -130,7 +129,6 @@ test("default config dictionary values", () => {
130129

131130
expect(configDict["pushIntegrationName"]).toBe(undefined)
132131
expect(configDict["autoPushRegistration"]).toBe(true)
133-
expect(configDict["checkForDeferredDeeplink"]).toBe(false)
134132
expect(configDict["inAppDisplayInterval"]).toBe(30.0)
135133
expect(configDict["urlHandlerPresent"]).toBe(false)
136134
expect(configDict["customActionHandlerPresent"]).toBe(false)

0 commit comments

Comments
 (0)