Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Siren not working with Push Notification requestAuthorization popup, it's displaying blank screen #338

Closed
dharmeshpatoliya opened this issue Jun 13, 2020 · 3 comments
Labels

Comments

@dharmeshpatoliya
Copy link

If you're experiencing a problem integrating Siren into your app, please provide the following information when posting a new issue:

  • Are you using the latest version of Siren?: Yes
  • What is your app's Bundle ID?: Used your example app (com.apple.AppStoreConnect)
  • When was the latest version of your app published to the App Store?:
  • Is your app published in the US App Store? If not, what App Store is it published in?:
  • Does Siren work if you plugin your app's BundleID (and countryCode, if necessary) into the Example app?: It works if I remove push notification request authorization code

`func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {

    window?.makeKeyAndVisible()
    
    UNUserNotificationCenter.current().requestAuthorization(options:[.badge, .alert, .sound]){ (granted, error) in }
           application.registerForRemoteNotifications()
    
    self.ConfigureSiren()

}`

`private extension AppDelegate {

func ConfigureSiren() {
    let siren = Siren.shared
    siren.rulesManager = RulesManager(globalRules: .critical,
                                      showAlertAfterCurrentVersionHasBeenReleasedForDays: 0)
    
    siren.wail { results in
        switch results {
        case .success(let updateResults):
            print("AlertAction ", updateResults.alertAction)
            print("Localization ", updateResults.localization)
            print("Model ", updateResults.model)
            print("UpdateType ", updateResults.updateType)
        case .failure(let error):
            print(error.localizedDescription)
        }
    }
}

}`

Please check the video: https://www.dropbox.com/s/kh5nznavrcul4df/saved%20video.mov?dl=0

@ArtSabintsev
Copy link
Owner

I would say, hold off on using Siren until a user has given a response to Push Notifications. Check to see if a response has bene given as a condition around Siren. See if that helps.

@dharmeshpatoliya
Copy link
Author

Thanks, do you have any sample code for that? Because I want to implement siren without issue.

@ArtSabintsev
Copy link
Owner

Hi,

Here is how you do a check to see if a user has been opted into Push already: https://dev.to/onmyway133/how-to-check-if-push-notification-is-actually-enabled-in-ios-20o8

I'd wrap that stuff around Siren. So if a user a has already given a yes/no response, on subsequent app launches, you can check to see that they have, and then do the Siren check.

Repository owner locked as resolved and limited conversation to collaborators Jun 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants