File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 77** Expo**
88- Added support for Expo SDK 53.
99
10+ ** Core**
11+ - Fixed an issue where opting the SDK after been opted-out would unexpectedly reset default configurations, such as Do Not Disturb setting.
12+
1013
111410.0.1
1215----
Original file line number Diff line number Diff line change @@ -117,10 +117,19 @@ - (NSDictionary*)getConstants {
117117RCT_EXPORT_METHOD (optIn:(RCTPromiseResolveBlock)resolve
118118 reject:(RCTPromiseRejectBlock)reject)
119119{
120- [BatchSDK optIn ];
121- dispatch_async (dispatch_get_main_queue (), ^{
122- [RNBatch start ];
123- });
120+ if (BatchSDK.isOptedOut ) {
121+ // Opt-in SDK
122+ [BatchSDK optIn ];
123+
124+ // Get API key and restart sdk
125+ NSDictionary *info = [[NSBundle mainBundle ] infoDictionary ];
126+ NSString *batchAPIKey = [info objectForKey: @" BatchAPIKey" ];
127+ dispatch_async (dispatch_get_main_queue (), ^{
128+ [BatchSDK startWithAPIKey: batchAPIKey];
129+ });
130+ } else {
131+ NSLog (@" RNBatch: Batch SDK is already opted-in" );
132+ }
124133 resolve ([NSNull null ]);
125134}
126135
You can’t perform that action at this time.
0 commit comments