File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -663,6 +663,20 @@ extension OneSignalUserManagerImpl {
663
663
jwtConfig. isRequired = required
664
664
}
665
665
666
+ /**
667
+ This is called when remote params does not return the property `IOS_JWT_REQUIRED`.
668
+ It is likely this feature is not enabled for the app, so we will assume it is off.
669
+ However, don't overwrite the value if this has already been set.
670
+ */
671
+ @objc
672
+ public func remoteParamsReturnedUnknownRequiresUserAuth( ) {
673
+ guard jwtConfig. isRequired == nil else {
674
+ return
675
+ }
676
+ OneSignalLog . onesignalLog ( . LL_DEBUG, message: " remoteParamsReturnedUnknownRequiresUserAuth called " )
677
+ jwtConfig. isRequired = false
678
+ }
679
+
666
680
@objc
667
681
public func subscribeToJwtConfig( _ listener: OSUserJwtConfigListener , key: String ) {
668
682
jwtConfig. subscribe ( listener, key: key)
Original file line number Diff line number Diff line change @@ -650,6 +650,9 @@ + (void)downloadIOSParamsWithAppId:(NSString *)appId {
650
650
[OneSignalCoreImpl.sharedClient executeRequest: [OSRequestGetIosParams withUserId: userId appId: appId] onSuccess: ^(NSDictionary *result) {
651
651
if (result[IOS_JWT_REQUIRED]) {
652
652
OneSignalUserManagerImpl.sharedInstance .requiresUserAuth = [result[IOS_JWT_REQUIRED] boolValue ];
653
+ } else {
654
+ // Remote params did not return IOS_JWT_REQUIRED
655
+ [OneSignalUserManagerImpl.sharedInstance remoteParamsReturnedUnknownRequiresUserAuth ];
653
656
}
654
657
655
658
if (result[IOS_USES_PROVISIONAL_AUTHORIZATION] != (id )[NSNull null ]) {
You can’t perform that action at this time.
0 commit comments