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 {
663663 jwtConfig. isRequired = required
664664 }
665665
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+
666680 @objc
667681 public func subscribeToJwtConfig( _ listener: OSUserJwtConfigListener , key: String ) {
668682 jwtConfig. subscribe ( listener, key: key)
Original file line number Diff line number Diff line change @@ -650,6 +650,9 @@ + (void)downloadIOSParamsWithAppId:(NSString *)appId {
650650 [OneSignalCoreImpl.sharedClient executeRequest: [OSRequestGetIosParams withUserId: userId appId: appId] onSuccess: ^(NSDictionary *result) {
651651 if (result[IOS_JWT_REQUIRED]) {
652652 OneSignalUserManagerImpl.sharedInstance .requiresUserAuth = [result[IOS_JWT_REQUIRED] boolValue ];
653+ } else {
654+ // Remote params did not return IOS_JWT_REQUIRED
655+ [OneSignalUserManagerImpl.sharedInstance remoteParamsReturnedUnknownRequiresUserAuth ];
653656 }
654657
655658 if (result[IOS_USES_PROVISIONAL_AUTHORIZATION] != (id )[NSNull null ]) {
You can’t perform that action at this time.
0 commit comments