File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
iOS_SDK/OneSignalSDK/Source Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ withSMSAuthHashToken:(NSString * _Nullable)hashToken
7878
7979- (void )updateLanguage : (NSString * _Nonnull)language
8080 appId : (NSString * _Nonnull)appId
81- withSuccess : (OSUpdateLanguageSuccessBlock)successBlock
82- withFailure : (OSUpdateLanguageFailureBlock)failureBlock ;
81+ withSuccess : (OSUpdateLanguageSuccessBlock _Nullable )successBlock
82+ withFailure : (OSUpdateLanguageFailureBlock _Nullable )failureBlock ;
8383
8484@end
Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ - (void)updateLanguage:(NSString * _Nonnull)language
391391 requests[userStateSynchronizer.getChannelId] = [userStateSynchronizer setLanguage: language withAppId: appId];
392392 }
393393
394- [OneSignalClient.sharedClient executeSimultaneousRequests: requests withCompletion : ^(NSDictionary <NSString *,NSDictionary *> *results) {
394+ [OneSignalClient.sharedClient executeSimultaneousRequests: requests withSuccess : ^(NSDictionary <NSString *,NSDictionary *> *results) {
395395 if (results[OS_PUSH] && results[OS_PUSH][OS_SUCCESS] && [results[OS_PUSH][OS_SUCCESS] boolValue ]) {
396396 [OneSignalUserDefaults.initStandard saveStringForKey: OSUD_LANGUAGE withValue: language];
397397 }
@@ -404,6 +404,11 @@ - (void)updateLanguage:(NSString * _Nonnull)language
404404
405405 if (successBlock)
406406 successBlock (results);
407+ } onFailure: ^(NSDictionary <NSString *, NSError *> *errors) {
408+ if (failureBlock) {
409+ NSError *error = (NSError *)[self getFirstResultByChannelPriority: errors];
410+ failureBlock (error);
411+ }
407412 }];
408413}
409414
You can’t perform that action at this time.
0 commit comments