Skip to content

Commit

Permalink
fixes for registerDevicetoken
Browse files Browse the repository at this point in the history
  • Loading branch information
hardikmashru committed May 13, 2024
1 parent 38d14f9 commit beb2beb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ios/RNIterableAPI/RNIterableAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ @interface RCT_EXTERN_REMAP_MODULE(RNIterableAPI, ReactIterableAPI, NSObject)

RCT_EXTERN_METHOD(disableDeviceForCurrentUser)

RCT_EXTERN_METHOD(registerToken: (nonnull NSString *) deviceToken)
RCT_EXTERN_METHOD(registerDeviceToken: (nonnull NSString *) token)

RCT_EXTERN_METHOD(setInAppShowResponse: (nonnull NSNumber *) inAppShowResponse)

Expand Down
10 changes: 7 additions & 3 deletions ios/RNIterableAPI/ReactIterableAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,15 @@ class ReactIterableAPI: RCTEventEmitter {
inAppHandlerSemaphore.signal()
}

@objc(registerToken)
func registerDeviceToken(deviceToken: String) {
@objc(registerDeviceToken:)
func registerDeviceToken(token: String) {
ITBInfo()

IterableAPI.registerToken(deviceToken)
if let deviceTokenData = token.data(using: .utf8) {
IterableAPI.register(token: deviceTokenData)
} else {
ITBInfo("Failed to convert device token string to data")
}
}

@objc(disableDeviceForCurrentUser)
Expand Down

0 comments on commit beb2beb

Please sign in to comment.