Skip to content

Commit

Permalink
Always set test type to 1 for simulators
Browse files Browse the repository at this point in the history
Cherry-pick of #1244

Our provision detection in OneSignalMobileProvision is not successfully able to find the embedded mobile provision for simulators. This might only affect Xcode managed provisioning profiles.

This change is a workaround to that issue to always set testType to 1 since simulators need to receive push in the sandbox environment.
  • Loading branch information
emawby committed Aug 10, 2023
1 parent 6c0cda3 commit 3e64983
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ class OSSubscriptionModel: OSModel {
// Set test_type if subscription model is PUSH
if type == .push {
let releaseMode: OSUIApplicationReleaseMode = OneSignalMobileProvision.releaseMode()
#if targetEnvironment(simulator)
if (releaseMode == OSUIApplicationReleaseMode.UIApplicationReleaseUnknown) {
self.testType = OSUIApplicationReleaseMode.UIApplicationReleaseDev.rawValue
}
#endif
// Workaround to unsure how to extract the Int value in 1 step...
if releaseMode == .UIApplicationReleaseDev {
self.testType = OSUIApplicationReleaseMode.UIApplicationReleaseDev.rawValue
Expand Down

0 comments on commit 3e64983

Please sign in to comment.