Inactive device token, urbanairship, cordova, ios - iphone

I am developing an app using cordova. For push notification, I am integration urbanairship. The device is getting registered successfully but the status of device token gets inactive.
I have created both development and production profiles but am unable to get device registered as active.
Can anyone help me out plz?

There are times during development or perhaps you’ve launched your app to the app store and you see either your token or messages of inactive tokens in your UA application. Device token as inactive when one of three things happen:
Apple tells us that the application has been uninstalled via the feedback service, which we check on a regular basis.
Apple rejected the device token for your app upon receipt of the notification at their servers
explicit delete call on the device token, which marks it as inactive and clears the alias and any associated tags.
If the device token was created when iOS 6 was installed, and the device has since updated to iOS 7, the old device token is eventually
rejected by Apple because the device now has a new, app-specific iOS 7
device token.
In any case, applications should expect and handle inactive device tokens properly. do one of the following:
Register the device token every time the application is opened,
Use feedback API regularly, store inactivated device tokens in your own database, and send registrations when the device token becomes
active again
Thank you. Hope it will help you.

If the device token is immediately inactive then it's a good sign that you've mixed your development and production environments. Remember, production certificates need to line up with production applications, from Apple all the way to Urban Airship. Likewise with development. If a development device token attempts to register as a production application, Apple will reject it and Urban Airship will mark it as inactive.
Here's another UA support article on how to create the appropriate type of application:
https://support.urbanairship.com/entries/69534443-Urban-Airship-Development-vs-Production-Apps

Related

Is it possible to get the device token even if Push Notification is not enabled?

I need to get the device token because I will use it for autologin. However, if the user did not allow Push Notifications from my App in his/her device, I will not be able to get the device token. I want to know if it's possible to get and store the user's device token even if he/she did not enable APN. Thanks.
Enabling/Disabling the push notification is just a setting. It doesn't stop the device from receiving the access token from APPLE
Check #Kimpoy's answer including the comments.
In my understanding on APNS, it doesn't depend on the user's action (as you mentioned that if when the user clicks on Don't Allow button) for your iOS to receive the Device Token.
If you included in your app:
- (void)application:didRegisterForRemoteNotificationsWithDeviceToken
This means that your iOS-based app is sending a request for Push Notification registration. In return, Apple sends the Device Token to the iOS; then the iOS sends the token to the app and then the app sends it to their service provider.
Not that when the user is asked "Don't Allow" doesn't mean that you're not going to receive the device token. Don't Allow refers to the action to be taken to any notification received by the app that is intended for the user. Say, location. This is a whole different thing. This means that the user doesn't allow the app to use his/her location.
Yes, it still receives the Device Token as what I have discussed in my answer to your question in #1. This is only a setting for your app, which means that you won't be receiving any visible notification (badge, message or a sound) whenever there are updates about any information in relevance to your application. It's like setting your Facebook account to only receive notifications when your friends sends you a private message. Other than that, you won't be notified at all.
The process of enabling APNS is:
Request for certificate Authority
Create app id
Configuring AppId for Push Notifications
Create provisioning profile
Provisioning a device
Enabling the profile in Xcode
Creating push notification provider.
For more understanding on APNS, check out this.
You still can get the device token even if the user disables it.

Apple Push Notification Registration & Device Token Receive clarification?

I am working on an iPhone app with Apple Push Notification integration. I have some doubts on this.
If the user clicked "Dont Allow" button in the APNS registration alert, will our code still receives the Device Token from APNS?
I have tested that when the user switched off the notification in iPhone notification, still the app receives the Device Token from APNS? It is correct?
Can anyone please clarify these doubts?
In my understanding on APNS, it doesn't depend on the user's action (as you mentioned that if when the user clicks on "Don't Allow" button) for your iOS to receive the Device Token.
If you included in your app:
- (void)application:didRegisterForRemoteNotificationsWithDeviceToken
This means that your iOS-based app is sending a request for Push Notification registration. In return, Apple sends the Device Token to the iOS; then the iOS sends the token to the app and then the app sends it to their service provider.
Note that when the user is asked "Don't Allow" doesn't mean that you're not going to receive the device token. "Don't Allow" refers to the action to be taken to any notification received by the app that is intended for the user. Say, location. This is a whole different thing. This means that the user doesn't allow the app to use his/her location.
Yes. it still receives the Device Token as what I have discussed in my answer to your question in #1.
This is only a setting for your app, which means that you won't be receiving any visible notification (badge, message or a sound) whenever there are updates about any information in relevance to your application. It's like setting your Facebook account to only receive notifications when your friends sends you a private message. Other than that, you won't be notified at all.
The process of enabling APNS is:
Request for certificate Authority
Create app id
Configuring AppId for Push Notifications
Create provisioning profile
Provisioning a device
Enabling the profile in Xcode
Creating push notification provider.
For more understanding on APNS, check this out.
I have tested with Xcode 6.1, ios8.1.2. Currently the device token will be generated only in two cases
Apple's default consent with "Ok" option
After "Dont allow", manual change in Setting->Notifications->app->AllowNotification(On)
By declining first time with apple's consent, will not generate device token, till manually change the value in settings page.

Apple APNS Device Token

We have table where Apple Device tokens are stored. This tables are different for testing and and for live application. I want to update this database manually with my iPhone device token for testing purpose.
Is there anyway I can read the device token from my iPhone.
Note: I do not hava MAC machine.
There's a tutorial here of how to get the device token, however it requires that your test application be added some code for you to run.
Tutorial link
If in case you have the code, try putting a log for the device token in the
didRegisterForRemoteNotificationsWithDeviceToken and then check the log in your phone using a console app.

Want to check Apple push notification Service on my device?

I have created iphone application which support Apple push notification service.
I also configured the server on windows which sends my device id to apple server.
I gets device ID whenever I launch application. But still i wont get any notification from
apple server, where notifications were also send to apple server from my local windows
server.
How should I check where my APN application is going wrong? Bcoz on server side, server didnt get any error message during sending messages to APN server, also on my iphone application I have properly registered for remote notifications. But still I dont get any notifications. Please help
If your application is not working for you, iron out you problems before letting third parties test your application. If your having trouble receiving notifications it won't be any better for the testers.
As how to actually beta test your app. Go to a commercial outfit or ad hoc by:
Have all testers submit their devices UDID as listed on the "Summary" tab from the device page in the iTunes application (click "serial number" to display the UDID).
Enter all UDID's into the device list on your iTunes Connect account.
Create a new provisioning profile with all your testers devices enabled.
Export your new app provisioning profile to xCode and rebuild.
Send the provisioning profile and fresh app to your testers instruction them to drop both on iTunes to install it on their iPhone.
Really, really thank your testers for their hard work.

Apple Push Notification Service

how to know my iphone device is registered or not for applepushnotification service?
Are you asking from a development perspective? Push notification can be enabled on a per-app basis in the iPhone Developer Program Portal under the App ID section. You need a valid and universally unique App ID.
If you're speaking from an accessibility standpoint for getting push notifications to your phone from a third party app, that is built into your phone and can be enabled/disabled from Settings on your iPhone.