2

I configured my app:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        // Override point for customization after application launch.
        let pushSettings: UIUserNotificationSettings = UIUserNotificationSettings(
                forTypes:[.Alert, .Badge, .Sound],
                categories: nil)
            UIApplication.sharedApplication().registerUserNotificationSettings(pushSettings)
            UIApplication.sharedApplication().registerForRemoteNotifications()
        return true
    }

func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
        print("My token is: \(deviceToken)");
    }

    // Failed to register for Push
    func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
        print("Failed to get token; error: %@", error) //Log an error for debugging purposes, user doesn't need to know
    }

Copy my device token, to my python script:

import time
from apns import APNs, Frame, Payload

apns = APNs(use_sandbox=True, cert_file='NodesDownCert.pem', key_file='NodesDownKey.pem')

# Send a notification
token_hex = 'xxx'
payload = Payload(alert="Hello World!", sound="default")
apns.gateway_server.send_notification(token_hex, payload)

I ran script, it didn't return errors, but i haven't received notifications at my Ipad. I tried php script from this tutorial, script returns "Message successfully delivered", but i'm still not receive any message. Php code here.

Any ideas how to debug or what is wrong ?

Arti
  • 7,356
  • 12
  • 57
  • 122

0 Answers0