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

iOS: Callbacks not executing when user selects "Don't Allow" #162

Open
eastbayjake opened this issue Feb 1, 2014 · 20 comments
Open

iOS: Callbacks not executing when user selects "Don't Allow" #162

eastbayjake opened this issue Feb 1, 2014 · 20 comments

Comments

@eastbayjake
Copy link

We were unable to get the success or error callbacks in register() to execute if an iOS 7 user opted to not allow push notifications. We tried using Cordova 3.3.1-0.1.2, 3.3.0-rc.1, and 3.4.0-rc.1 with the latest version of PushPlugin. We were definitely calling window.plugins.pushNotification.register() with the correct args -- no errors in PushNotification.js -- but it never called back from the cordova.exec in PushNotification.js.

Thank you for all your hard work on this plugin!

@KinG-InFeT
Copy link

I confirm this issue..... Please fix this

@KinG-InFeT
Copy link

for my debugging, you can view this topic that I've added a short time ago:
https://issues.apache.org/jira/browse/CB-5958

@KinG-InFeT
Copy link

new issue ticket #164

@abelabbesnabi
Copy link

My apps are getting rejected by Apple. because when user clicks "Don't Allow", my callback that loads the app (From external website) never executes and the app never loads the content. This is really critical.

Is there an update on the fix?

Thanks a lot.

@jeremiahkonkle
Copy link

I can confirm that if either the "Don't Allow" was selected or the "Alert Type" for the app in Notification Center is set to "None" that the registration method "hangs" and doesn't call either success or error callback.
I am investigating how to fix this. Does anyone have any updates?

@brad
Copy link

brad commented Mar 27, 2014

Found a horrible, hacky workaround for this:

some_global = false;
function onNotificationAPN() {}
function tokenHandler(reg_id) {
    some_global = true;
    // Proceed as normal with our registration id
}
function errorHandler(error) {
    if(some_global === false) {
        // Here we assume there was an error with registration,
        // and proceed with our app execution under that assumption
    }
}
document.addEventListener('deviceready', function() {
    pushNotification.register(tokenHandler, errorHandler, {
        "badge":"false",
        "sound":"true",
        "alert":"true",
        "ecb":"onNotificationAPN"
    });
    // We assume that if the register callback hasn't happened
    // within 2 seconds, there must have been some error.
    setTimeout(errorHandler, 2000);
}, false);

If you have even a shred of self respect or dignity, you won't use this kludge. Fortunately for me I have neither, so this will work for now. :neckbeard:

@woutse
Copy link

woutse commented Apr 29, 2014

Have the same problem with ios7. Anyone with a proper solution? Luckily i have no self respect and will use the timeout solution.

@houdang
Copy link

houdang commented Apr 29, 2014

bumb! phonegap is useless without fixing essential bugs !! @adobe

@bendenoz
Copy link

+1 (app rejected because of this)

@anton-suprunov
Copy link

this is very useful to show alerts for users when they disabled notifications, please implement

@mica16
Copy link

mica16 commented Jan 31, 2015

Is it fixed ?

Thanks

@JackNova
Copy link

JackNova commented Feb 3, 2015

bug is still there

@legalimpurity
Copy link

+1 (serioudly app rejected because of this )

@dhatawesomedude
Copy link

+1 (app rejected because of this). This is not limited to iOS. On android, If a user doesn't have GCM installed or disabled, the app hangs too, error callback isn't called. Any plans to fix this?

@korbinianhackl
Copy link

+1 same issue here... would be very thankful for a fix!

@anuj6117
Copy link

Is there any fix available yet?

@jryu01
Copy link

jryu01 commented Jul 16, 2015

+1 same issue.

@cmellinas
Copy link

+1 big issue

@Reza-sh
Copy link

Reza-sh commented Jul 31, 2015

Hi,

I created this pull request for this issue. It solves the problem for iOS8 and higher.
#615

@misterfitz
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests