question

NamrathaPrakash-3128 avatar image
1 Vote"
NamrathaPrakash-3128 asked SoumyadipBanerjee-2269 answered

Unable to receive Push Notification in iOS Device (iPhone)

Hi,

I am trying to integrate Push Notification using Azure Notification Hub.

Azure Portal
Created a New notification hub and added required setting in APNS
I tried with both Authentication Mode(Certificate/Token)

Client
Receiving logs saying "Registered for push notifications with token: <devicetoken>"
But unable to receive the test Push notification sent to iPhone

in portal receiving success message saying when test notification sent to Apple Platform
"Successfully sent test message. Outcome: {0 passed, 0 failed}. Please see result section for details."

Please help me out in this, Also I am not able to find any documentation/Tutorial kind for Integrating with an iOS app using Swift.

azure-notification-hubs
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ShowndaryaMadhavan avatar image
0 Votes"
ShowndaryaMadhavan answered NamrathaPrakash-3128 commented

Hi @NamrathaPrakash-3128

This documentation should help you with the certification/token generation process to check if you are following the right steps: https://docs.microsoft.com/en-us/azure/notification-hubs/ios-sdk-get-started

While generating the push certificate, try the Production Push Certificate if Developer isn't working as it helps sometimes even if you are using XCode and select the same accordingly in the azure portal while setting up authentication (production or sandbox)

Hope this helps!

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks, @ShowndaryaMadhavan

Actually I have followed the same steps provided in the:https://docs.microsoft.com/en-us/azure/notification-hubs/ios-sdk-get-started while creating the certification/token generation process.

Tried with both production certificate and development certificate. Still having the same issue.

More Details:
Currently, I am using Xcode11.6 Target iOS 13.3 +
In Client, I am using "MSNotificationHub.start(connectionString: connectionString, hubName: hubName)" From WindowsAzureMessaging.framework

in portal receiving success message saying when test notification sent to Apple Platform
"Successfully sent test message. Outcome: {0 passed, 0 failed}. Please see result section for details."

Also in the Result section
Message was successfully sent, but there were no matching targets.

Am not sure what I am missing out, If you have any documentation regarding the " Integrating with an iOS app using Swift." Please share it out

0 Votes 0 ·
sadomovalex avatar image
0 Votes"
sadomovalex answered sadomovalex published

hello, how exactly do you send push notifications: via custom app or from Azure portal > Notification hub > Test? I would recommend first send them via Azure portal - if they will work from there then problem may be in the custom client.

Also I highly recommend to use Visual Studio 2019 Server Explorer when you work with Azure notification hubs. It allows to see list of all active device registrations (Android and Apple), their tags and expiration dates - very useful feature which is missing is Azure portal. It also allows to send test push notifications and see sending details per registration ids. More details can be found here: Visual Studio Server Explorer.

dn530751.46dad9ca-937d-4463-a392-73c0b55504de(azure.100).png


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SoumyadipBanerjee-2269 avatar image
0 Votes"
SoumyadipBanerjee-2269 answered

I'm facing this exact same issue. I can see the device registered in the notification hub using the GetAllRegistrationsAsync() method in my .net api. But when I send the message from portal using that tag I'm getting the same message:
"Successfully sent test message. Outcome: {0 passed, 0 failed}. Please see result section for details."

Also in the Result section
Message was successfully sent, but there were no matching targets.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.