Apple APNS Device Token - iphone

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.

Related

Get data from all app's notification in IOS

I would like to develop an IOS app to get notification such as title and body from all applications in iPhone. Is it possible to do that?
No it is not. On Android, yes this is possible. But not on Apple. They restrict permissions so that you cannot access that information as a developer.
Every application is given a sandbox, a directory it can use to store data in. If the application needs access to data on the device that isn't located in the application's sandbox, it needs to request the data through a system interface.
App can only read their notifications, other things are possible with Jailbreak.
Learn about app sandbox here

Inactive device token, urbanairship, cordova, ios

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

Persistent device identifier even after app gets uninstalled

In my iPhone/iPad app's use case, there is a voting system and one device can send its vote once to the server. Therefore my server needs to identify user's device. I don't want the user to register an account because that makes the app complicate. However, I couldn't find a solution that works.
UDID is deprecated
I presume getting MAC address will get your app rejected by the app review process
I tried creating my own UUID using [[NSUUID UUID] UUIDString] and then storing it using NSUserDefaults, but the settings disappear if the user uninstalls the app
identifierForVendor is also reset when the user uninstalls the app
I considered advertisingIdentifier but because I'm not using it for advertisement, I presume it will also be rejected by the app review process
I'm not asking for a bulletproof solution in every situation. Just a solution that works even if the user uninstalls the app. Because I can generate my own UUID, I guess my question boils down to: How I can save data for the app that survives app uninstallation?
However if any of you have other approach, please feel free to inform me. Thanks.
Save the UUID into the keychain.

Is Device token for ANPS changed if i download same application after deleting it?

I want to know about changing DeviceToken for same Device.
Here I explain you,
Suppose i download application from AppStore to my device, then app will register device token to server. - lets say it is TOKEN1
Now i delete that app from my Device.And again download that app from AppStore, then the app will again register device token to server. - lets say it is TOKEN2
My question is is TOKEN1 and TOKEN2 are Same?
please clear my doubts.
Thank you,
They will be same as far as device certificate is same for application.
For further information read apple docs
It says : APNs generates a device token using information contained in the unique device certificate

how to avoid twitter already authorized on the device using share kit in iphone sdk

I used sharekit for twitter integration in my app. That works fine on the simulator. But on the device , for the first time it allows me to login into the twitter . Now i deleted the app from the device and create new build and deploy that into device again. Now it shows already authorized for twitter , not able to login even i deploy the new build on the device
Any ideas..to avoid this.
Thanks in advance..
The data for Sharekit's Twitter implementation are stored in the user's keychain when you run on the device. Because of this, deleting the app will not delete the token for Twitter stored in the keychain by Sharekit. When you delete and reinstall the app, it's still reading from the keychain and picking up the old credentials. You need to implement the logout functionality. The implementation is pretty simple. You just call
[SHKTwitter logout];
Check out the ShareKit documentation for details and options.