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 Push notification - no system alert #2998

Closed
1 of 4 tasks
mpawlak96 opened this issue May 28, 2020 · 11 comments
Closed
1 of 4 tasks

iOS Push notification - no system alert #2998

mpawlak96 opened this issue May 28, 2020 · 11 comments

Comments

@mpawlak96
Copy link

Bug Report

After recompile my app. Application isnt asking on iOS to push notification access (system alert). Last days i updated my xcode (11.5).

From App im getting token (see below) but modal for push notification wont show. Probably this token is for local push notifications ? By Apple Push Service i cant push hany notification. im getting error number: 475

Capacitor Version

npx cap doctor output:

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 2.1.1

@capacitor/core: 2.1.1

@capacitor/android: 2.1.1

@capacitor/ios: 2.1.1

Installed Dependencies:

@capacitor/cli 1.5.1

@capacitor/ios 2.0.0-beta.1

@capacitor/core 1.5.1

@capacitor/android 1.5.1

[success] Android looking great! 👌
Found 6 Capacitor plugins for ios:
capacitor-firebase-analytics (0.3.2)
cordova-open-native-settings (1.5.2)
cordova-plugin-facebook4 (6.4.0)
cordova-plugin-purchase (10.0.1)
cordova-plugin-qrscanner-ean (1.0.1)
cordova-plugin-smartlook (1.0.0)
[success] iOS looking great! 👌

Affected Platform(s)

  • Android
  • iOS
  • Electron
  • Web

Console debug:

⚡️ To Native -> PushNotifications register 118480378
⚡️ To Native -> PushNotifications addListener 118480379
⚡️ To Native -> PushNotifications addListener 118480380
⚡️ To Native -> PushNotifications addListener 118480381
⚡️ To Native -> PushNotifications removeAllDeliveredNotifications 118480382
⚡️ To Native -> App addListener 118480383
⚡️ TO JS {"value":"XXXXXXXXXXX"}
⚡️ [log] - Push registration success, token: XXXXXXXXXXXXX

Expected Behavior

Sample Code or Sample Application Repo

Main file:
useEffect(() => { pushNotificationsInit(dispatch, history) }, [])

pushNotificationsInit:

`export default (dispatch, history) => {
const { PushNotifications, App } = Plugins
PushNotifications.register()

PushNotifications.addListener('registration',
async (token) => {
console.log(Push registration success, token: ${token.value})
[..]`

Other Technical Details

npm --version output: 6.14.4

node --version output: v12.16.2

pod --version output (iOS issues only): 1.8.3

Other Information

https://stackoverflow.com/questions/62047012/push-notification-alert-doesnt-show

@jcesarmobile
Copy link
Member

Can you provide a sample app?

@jcesarmobile jcesarmobile added the needs reply needs reply from the user label May 28, 2020
@mpawlak96
Copy link
Author

Hello! Yes. give me a few mins to prepare a sample app

@mpawlak96
Copy link
Author

@jcesarmobile I added you to my private project, please check DM

@mpawlak96
Copy link
Author

Generally i tried to create fresh app based on newest version of capacitor and i only added pushinit (the same as in project which i shared you) and problem is the same - im not getting system alert modal (im getting toket but this token doesnt work).

Please help :<

@jcesarmobile
Copy link
Member

you have not committed the src folder

@mpawlak96
Copy link
Author

Im so sorry ;). Now i pushed src/ to master branch

@jcesarmobile
Copy link
Member

since v2 of capacitor, register doesn't request the permissions, there is a requestPermission method for that

it was mentioned in the breaking changes
https://github.com/ionic-team/capacitor/releases/tag/2.0.0

but I guess it should be documented better

@jcesarmobile jcesarmobile added docs and removed needs reply needs reply from the user labels May 29, 2020
@jcesarmobile
Copy link
Member

it's requestPermission(), not requestPermissions()

you've deleted the comment where you say you can't find requestPermission(), but that's because you have not updated @capacitor/core, as I said, it was included in v2, you have to update all capacitor packages

@mpawlak96
Copy link
Author

Yes now i see requestPremission and it works fine!

Last question. how can i get i get information in event 'registration' that it is a remote token ?

@jcesarmobile
Copy link
Member

there are only remote tokens, so whatever you get in registration event is a remote token

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 11, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants