iPad didn't call didRegisterForRemoteNotificationsWithDeviceToken - objective-c

I'm trying to get device token in iPad for remote push notifications;
registerForRemoteNotificationTypes is called okay, no error, but didRegisterForRemoteNotificationsWithDeviceToken also not been called;
Application is appear in Settings/Notification;
What's I doing wrong?
iPhone is registering successfully.
Thank you
PS: iPad 1, iOs 5.1

In this case, if the code works on iPhone that code should work on iPad as well. Coz the os is same. Anyway if your code is not working on iPad try to remove provisioning profile from the iPad and reinstall the correct one. Sometime the old provisioning profile remains. And don't forget to check the code signing on target as well.

check that you are registering correctly for Push Notifications, including verifying your provisioning profile for "aps-environment" key and the code signing of the .app.
also you can debug Push Notification status messages in the console (you will need to install PersistentConnectionLogging.mobileconfig provisioning profile on your device and reboot it. check out this link under "Observing Push Status Messages").

There is an important thing to know with the provisioning profile. You should ensure to create the certificate first (the one used for the notifications), and then recreate the provisioning profiles, so that they know about the notifications. So you're sure it's not a provisioning profile issue.

Well, problem was solved in production sign and provisioning, but not in development. When I archive application for device and load it through iTunes, push notifications is working. Very strange behaviour.

I know it's a late answer, but it may help others. I had the same issue as the OP. After you click ok on the notification popup, it disappears but none of the method gets called to get the device token. Then I checked the internet connection when testing push notifications and I realized I had no connection. After re-connecting, it began working fine.

Related

Is it possible to force Chrome to refresh app notification settings when using Notification delegation

In a previous answer regarding Notification Delegation between Chrome and an Android TWA app it was said that:
"If the TWA has notifications disabled in Android Settings, we disable
them in Chrome instead. There's a little bit of latency with how this
gets propagated, but things should get updated on the next TWA launch
at latest.
How exactly Notification Delegation does work?
On my site I am sending the user to androids app notification settings when I find that notifications are not allowed in the browser.
But upon the users immediate return, the changes are not propagated to Chrome (to be expected from the comment above since the TWA is not launched again).
I wonder if there is anyway I can speed this up? Otherwise the user is forced to exit the page completely and restart the app before the permission is granted, which is not a very good user experience.
It seems the only workaround would be to force restarting the application, which is not a great user experience. I have filed an issue on Chromium bugs to track a fix for this: https://bugs.chromium.org/p/chromium/issues/detail?id=1064300

Mac App crashes when I add a Distribution Profile

I've created a Mac App for Mavericks that uses MapKit. It works fine during development and testing on Xcode 5.1. Now I'd like to submit it to the App Store and I need a Distribution Profile which I've created successfully. Trouble is, as soon as I add it to my project, the app doesn't run anymore - it crashes every time without fail with this error message:
When I change back to "no provisioning profile", or to the profile that Xcode created during development, the app runs again.
My question: Is this expected behaviour, or will the app be rejected by the review team? I know that iOS apps don't run with their distribution profiles, but I'm new to Mac Development. Any insights into this way too complex topic are appreciated!
My app was approved - and the crash was indeed no issue for the app review team.
I had a chat with Apple about this who were kind enough to call me back and explain the issue. Looks like this phenomenon is "kind of" expected behaviour: Mac Apps may or may not crash when run with a Distribution Profile.
To avoid this problem, we can add both a Development AND a Distribution Profile to our app, without one having to replace the other. This was news to me. Had I however opened my tired eyes a bit wider I would have perhaps spotted the little disclosure triangle myself:
Perhaps this helps those with the same issue.

App Wireless Distribution not working in iOS7. Internet Connection needed?

In iOS6 I used to install some of my apps over an adhoc network without internet sharing. So the iPad had no internet connection. Therefore I use a typical html and plist file. Everything was alright.
Now, in iOS7 the installation is not working anymore. It is just stuck in "Waiting" and nothing more happens. (Note: It is still working on my iOS6 iPad)
First I thought something might be wrong with my plist, but then I copied the files to my IIS Server and installed it from there. Here I had a internet connection on my iPad and everything worked out.
Is it possible that the wireless distribution now needs an internet connection in iOS7 e.g. to check the ipa in the app store or something like that? Because this is the only difference I can see.
The app is signed with a valid distribution profile.
Thanks for your help.
It turned out the installation of apps over the air in iOS 7 really needs an internet connection now. The iPad tries to contact at least the following URLs before installing the app.
ax.init.itunes.apple.com: The device obtains the current file-size limit for downloading apps over the cellular network.
ocsp.apple.com: The device contacts this site to check the status of the distribution certificate used to sign the provisioning profile.
It seems in iOS6 it was ok if those URLs were not reachable and now in iOS 7 they have to be reachable.
Well i just had the same problem and I figured it out. At least on my xcode this is what happened. Turns out the application target release code siging identities auto set to developer and not their current state, from xcode 4.x, which is distribution. So when I went to distribute my application I kept getting the same error you had. So Click on your project name in your project explorer then click on the application target, not the project, and make sure the code signing identity is not set to developer for your releases. I have no idea why the code signing identities were automatically set to the developer profile, maybe there was some sort of bug when updating from xcdoe 4.x to xcode 5 that caused this. But now other devices are able to install the program. Hope this helps.

ABAddressBookGetAuthorizationStatus in simulator always returns kABAuthorizationStatusAuthorized

I am updating an app for iOS 6 Address Book authorization and have hit a problem in testing. The simulator always returns that authorization is granted. This means I do not see the dialog popup requesting permission and can therefore not test that code path. Ok, use a device instead... The problem there is the OS appears to remember my answer so only asks once. Deleting the app does not help. On reinstalling it has retained the permission setting from before, so again no popup.
Resetting the simulator does not help and if you go into the Privacy settings on the simulator no apps are listed as requesting permission to the Address Book.
The only option I have is use another iOS device that has never had our app installed on for each test. This cannot be how you are supposed to test this. Any ideas anyone?
Thanks
Found it. From the device, Settings->General->Reset->Reset Location & Privacy. So you have to do that for each test

"The device does not recognize this host message when running app on the device" [duplicate]

I'm trying to profile my application using Instruments on the device itself. Specifically, I'm trying to do time profiling.
Unfortunately, I just can't get it to work. Here's the situation:
1) If I run instruments with the app signed using the developer profile on the simulator, it works.
2) If I run instruments with the app signed using the distribution profile on the simulator, it works.
3) If I run instruments with the app signed using the distribution profile on the device (which is the default case for profiling since the scheme is set to use the release build) then Xcode complains about that there's no valid provisioning profile. That seems reasonable.
4) If I run instruments with the app signed using the developer profile on the device, then Xcode transfers the app, but then states that it's "Finished running" immediately. The app isn't run, and in most cases there's no error message.
Sometimes, just sometimes, there's a message from the Organiser stating that device does not recognise host - E800001C.
5) Running the app directly using the developer profile works fine - I can debug as expected.
Summary - I can't run an app on a device through Instruments using a debug build - it stops before it's had a chance to start. There are no error messages - nothing at all in the debug console.
Help?
Thanks,
Tim
I've solved this. It hadn't occurred to me to check the console inside the organizer. It said:
: entitlement 'keychain-access-groups' has value not permitted by a provisioning profile
After a bit of Googling I discovered that deleting the app from the device would solve my issue. Now I can profile.
So easy when you know how. Hope that helps someone else.
Tim
First of all app can be executed on simulator without signing it. Now apple has provided us the developer profile to test the app on devices.
Distribution profiles are created for submitting the app to the apple store or when application has to be distributed to the employee within the enterprise.
If want to do profiling on device do it with developer one. It should work.