Skip to content

Commit

Permalink
iOS production push token fix (#81)
Browse files Browse the repository at this point in the history
* iOS production push token fix

* Changelog updated
  • Loading branch information
ijunaid authored Dec 15, 2022
1 parent 80b1b85 commit 1211702
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 22.02.1
* SDK has been internally slightly reworked to support a "no push notification" variant.
* Fixed incorrect iOS push token type when passing "Countly.messagingMode.PRODUCTION" as token type.
* Underlying android SDK version is 22.02.1
* Underlying iOS SDK version is 22.06.0

Expand Down
11 changes: 8 additions & 3 deletions ios/Classes/CountlyFlutterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ + (CountlyFeedbackWidget *)createWithDictionary:(NSDictionary *)dictionary;
// #define COUNTLY_EXCLUDE_PUSHNOTIFICATIONS
BOOL BUILDING_WITH_PUSH_DISABLED = false;

CLYPushTestMode const CLYPushTestModeProduction = @"CLYPushTestModeProduction";

NSString* const kCountlyFlutterSDKVersion = @"22.02.1";
NSString* const kCountlyFlutterSDKName = @"dart-flutterb-ios";
NSString* const kCountlyFlutterSDKNameNoPush = @"dart-flutterbnp-ios";
Expand Down Expand Up @@ -452,10 +454,13 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
dispatch_async(dispatch_get_main_queue(), ^ {
config.sendPushTokenAlways = YES;
NSString* tokenType = [command objectAtIndex:0];
config.pushTestMode = CLYPushTestModeProduction;

if([tokenType isEqualToString: @"1"]){
config.pushTestMode = @"CLYPushTestModeDevelopment";
} else {
config.pushTestMode = @"CLYPushTestModeTestFlightOrAdHoc";
config.pushTestMode = CLYPushTestModeDevelopment;
}
else if([tokenType isEqualToString: @"2"]) {
config.pushTestMode = CLYPushTestModeTestFlightOrAdHoc;
}
});
#endif
Expand Down

0 comments on commit 1211702

Please sign in to comment.