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

PushNotification .on('registration', function(data) {} on ios with APNS is not executed! #202

Open
xandervisma opened this issue Oct 10, 2022 · 5 comments · May be fixed by #285
Open

PushNotification .on('registration', function(data) {} on ios with APNS is not executed! #202

xandervisma opened this issue Oct 10, 2022 · 5 comments · May be fixed by #285

Comments

@xandervisma
Copy link

xandervisma commented Oct 10, 2022

Bug Report

Hi, Previously we always used the cordova-plugin-push but because it is deprecated we switched to havesource/cordova-plugin-push.
On android with GCM it works perfectly. But on ios with APNS the push.on('registration', function(data) {} is not fired/triggerd/executed.
Please help me out!

Expected Behaviour

push.on('registration', function(data) {} needs to fired/triggerd/executed

Actual Behaviour

push.on('registration', function(data) {} is not fired/triggerd/executed.

Reproduce Scenario (including but not limited to) / ### Steps to Reproduce

Install cordova project with this plugin and use the APNS way. The APNS is used when there is no google plist file in your config or root folder. Put a Alert or Console.log in the push.on('registration', function(data) {} and test it.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

iphone simulator with iOS 14 or higher

Sample Code that illustrates the problem

`
var push = PushNotification.init({
android: {
senderID: "",
icon: "push",
iconColor: "blue",
forceShow: true,
soundname: "mysound",
sound: "true"
},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
},
ios: {
alert: "true",
badge: "true",
clearBadge: "true",
soundname: "mysound",
sound: "true"
},
windows: {}
});

		push.on("registration", function(data) {
			alert(data);

			window.registrationId=data.registrationId;
		});

});

`

Thank you very much!

Kind regards,

Xander

@xandervisma xandervisma changed the title PushNotification .on('registration', function(data) {} not executed! PushNotification .on('registration', function(data) {} on ios with APNS is not executed! Oct 10, 2022
@GexxOn
Copy link

GexxOn commented Dec 2, 2022

adding FirebaseAppDelegateProxyEnabled to NO in my info.plist file did the trick
https://stackoverflow.com/a/51518574/3730949

@xandervisma
Copy link
Author

Thank you very much!
My team and I are going to try this out.

@GexxOn
Copy link

GexxOn commented Dec 5, 2022

i also noticed 'registration' is not called within the simulator - so you have to plug in your device
you will see the Push Plugin register success: {length = 32 ... msg in your console

@geoidesic
Copy link

I'm having the same issue but Info.plist is no longer a thing in Xcode 15.4 and I can't find that setting anywhere.

@maxs15
Copy link

maxs15 commented Aug 9, 2024

@geoidesic, check the pull request (#283 ) I just published. It might help you.

@erisu erisu linked a pull request Aug 30, 2024 that will close this issue
9 tasks
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

Successfully merging a pull request may close this issue.

4 participants