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

isRemoteNotificationsEnabled always returns false on iOS 10 #121

Closed
Dakuan opened this issue Sep 20, 2016 · 5 comments
Closed

isRemoteNotificationsEnabled always returns false on iOS 10 #121

Dakuan opened this issue Sep 20, 2016 · 5 comments
Labels
bug Something isn't working properly

Comments

@Dakuan
Copy link

Dakuan commented Sep 20, 2016

window.cordova.plugins.diagnostic.isRemoteNotificationsEnabled((enabled) => {
  // enabled is always false
})

was working a charm on iOS 8 & 9, but always false on iOS 10, regardless of what the user has accepted.

@Dakuan Dakuan changed the title isRemoteNotificationsEnabled always returns true on iOS 10 isRemoteNotificationsEnabled always returns false on iOS 10 Sep 20, 2016
@vivekpd15
Copy link

+1

@dpa99c
Copy link
Owner

dpa99c commented Sep 21, 2016

iOS 10 has made some fundamental changes to user notifications. I need to update this plugin to handle them. So this is a bug in the sense that the plugin doesn't yet support the new methods introduced in iOS 10.

@dpa99c dpa99c added the bug Something isn't working properly label Sep 21, 2016
@dpa99c dpa99c closed this as completed in 31ceedc Sep 22, 2016
@dpa99c
Copy link
Owner

dpa99c commented Sep 22, 2016

Fix published in v3.2.0 to npm

@vivekpd15
Copy link

vivekpd15 commented Sep 23, 2016

I tried making a new build using this update, but I am being greeted with this error:

.../cordova_project/platforms/ios/vImmune/Plugins/cordova.plugins.diagnostic/Diagnostic.m:13:9: fatal error: 'UserNotifications/UserNotifications.h' file not found
#import <UserNotifications/UserNotifications.h>
^
1 error generated.

I am using Cordova 6.2.0. Any ideas why this is happening?

@dpa99c
Copy link
Owner

dpa99c commented Sep 23, 2016

@vivekpd15 This error is being raised because the new UserNotifications framework (added in XCode 8 / iOS 10) is not being found.
The latest version of this plugin (v3.2.0) injects this framework dependency into the XCode project, so uninstalling the old plugin version from your project and installing the latest version should be enough to satisfy this dependency.
However, it seems for some reason in your case, this has not happened. So open your Cordova iOS project in XCode and check if the UserNotifications framework is included. If not, add it manually.
And of course you must be using the latest XCode 8, because UserNotifications framework was only added for iOS 10 in this version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working properly
Projects
None yet
Development

No branches or pull requests

3 participants