apple-push-notifications

Determine whether app is communicating with APNS sandbox or production environment

时光总嘲笑我的痴心妄想 提交于 2019-11-30 00:21:24
I have push notifications set up in my app. I'm trying to determine whether the device token I've received from APNS in the application:didRegisterForRemoteNotificationsWithDeviceToken: method came from the sandbox or development environment. If I can distinguish which environment initialized the token, I'll be able to tell my server to which environment to send the push notification. I've tried using the DEBUG macro to determine this, but I've seen some strange behavior with this and don't trust it to be 100% correct. #ifdef DEBUG BOOL isProd = YES; #else BOOL isProd = NO; #endif Ideally, I'd

When is didRegisterForRemoteNotificationsWithDeviceToken called?

一曲冷凌霜 提交于 2019-11-30 00:10:54
问题 There are a lot of questions about didRegisterForRemoteNotificationsWithDeviceToken but they all sidestep a very direct question which I cannot seem to find an exact answer to. For an app which is properly set up for notifications in all other ways and has proper network connectivity: when is didRegisterForRemoteNotificationsWithDeviceToken called? Some possible choices might be: Every time the app starts Only after the initial prompt to the user to accept push notifications Something else?

What iPhone push notification services are out there? (Hosted services, not the APNS) [closed]

梦想的初衷 提交于 2019-11-29 23:21:36
I'm looking to avoid running my own server all the time when dealing with Apple's push notification service. From my understanding, I need a constant connection to the APNS which I can't afford... I was planning on releasing my app for 0.99 or for free and I really don't want to spend a lot of money elsewhere. After a bit of googling I found sites like http://www.appnotify.com which seems really interesting (and may be a perfect match for me). Are there any other services similiar to this one out there? We found the following services parse.com Xtify.com pushwoosh.com urbanairship.com prowlapp

Stopping ios 7 remote notification sound

╄→гoц情女王★ 提交于 2019-11-29 23:08:18
问题 In iOS 7, when a user swipes one of my notifications from the lockscreen and is taken to my app, the notification sound keeps playing (unlike iOS 6). Is there any way to programmatically stop that sound when my app launches in iOS 7? NOTE: see the accepted answer for a shoddy workaround. 回答1: I'm pretty sure this is a bug on Apple's end, see devforums.apple.com/message/888091 (thanks Gui13). File a duplicate bug report to get Apple to pay attention to it, as that is how Apple assigns priority

iOS push notifications behavior when app is deleted and then reinstalled

↘锁芯ラ 提交于 2019-11-29 23:06:37
I've encountered an unusual scenario where a user is continuing to receive notifications when my app has been deleted and then reinstalled. The scenario is as follows: user installs the app from the appstore user logs onto our app and we register them for notifications user deletes the app from their device user reinstalls the app from the appstore user receives a notification even though they have not started the app up yet, logged in, etc My understanding of the APNs architecture was that once your app is deleted from your device, it is de-registered from APNs by the OS itself. A reinstall

iOS 10 UNUserNotificationCenterDelegate not called. push notifications not working

瘦欲@ 提交于 2019-11-29 23:01:42
Tearing my hair out tying to get push notifications to work in iOS10. Current setup: in func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool : if #available(iOS 10.0, *) { let center = UNUserNotificationCenter.current() center.delegate = self center.requestAuthorization(options: [.alert, .badge, .sound]) { (granted, error) in if error == nil { print("DID REQUEST THE NOTIFICATION") UIApplication.shared.registerForRemoteNotifications() } } print("DID SET DELEGATE") } In func application(_ application:

How to use Objective C to send device token for push notifications and other user settings to sql table on server

南楼画角 提交于 2019-11-29 22:41:31
Ideally, I would like to send an HTTP Request using POST to the Push Notification Server that contains the device token as well as some user-defined settings. From there I can set up a php script on the server to deal with the incoming data and input it into an sql table. If this is the only way to do it, how would I go about initiating and HTTP Request from Objective C? You'll first need to convert the device token to a hex string with a function like this: - (NSString*)stringWithDeviceToken:(NSData*)deviceToken { const char* data = [deviceToken bytes]; NSMutableString* token =

Upload new APNS certificate to GCM

陌路散爱 提交于 2019-11-29 22:30:21
问题 We have an app for iOS and Android that uses GCM. I'm trying to upload a new production APNS certificate to GCM but I can't because Google is moving GCM to Firebase. How do I do that? Here's a screenshot of the Google Developer Products. There's no GCM now. 回答1: I would suggest that you move to Firebase Cloud Messaging (FCM). If you go to the Firebase console you will be able to create a new Firebase project or import an existing Google project. Once you are in your Firebase project you will

iOS Enterprise developer Account: get device token

£可爱£侵袭症+ 提交于 2019-11-29 21:08:50
I have used the iOS development account for creating APNS SSL certificate for sending the push notification to an iOS device for development purpose. I can get the device token using objective c sample code in iOS device.Then I can use that device token to send push notification for that specific iOS device. Now I am going to implement MDM and for MDM iOS Enterprise account is required. There are some questions, which I want to confirm if someone has already done. So I want to know can I use iOS Enterprise account for creating "apns ssl certificate" for development purpose? Can I get device

Receiving push notification on PhoneGap for iOS

独自空忆成欢 提交于 2019-11-29 20:43:34
Hello everybody I would like to receive Apple push notifications through my PhoneGap container. Does anybody now if it has already been implemented? Thanks a lot Yes, you can. See Urban Airships documentation for Phonegap iOS plugin Ahmad Kayyali Yes we can check these links: can we do push notification in iphone using phonegap fremwork? How to implement UA push notifications with PhoneGap This one is pretty good - https://github.com/phonegap-build/PushPlugin Here is a tutorial using the above - http://devgirl.org/2013/07/17/tutorial-implement-push-notifications-in-your-phonegap-application/