GCM and swift can register and receive a success notification but no other push noteificiatons <p>Update: Ok so I redid all my certs and now I am getting this by testing the GCM at this site <a href="http://techzog.com/development/gcm-notification-test-tool-android/" rel="nofollow">http://techzog.com/development/gcm-notification-test-tool-android/</a></p> <pre><code> URL: http://android.googleapis.com/gcm/send Headers: Array ( [0] =&gt; Authorization: key=AIzaSyBPTQGXlyImFWPda1s2LVUKIN98uMS0Bac [1] =&gt; Content-Type: application/json ) 1 Fields: Array ( [registration_ids] =&gt; Array ( [0] =&gt; fBspb1tyYDg:APA91bE0-pzjJrJodW2JuNvnEZSkUaw0rBjf0gkwu2Yi9GaS8WcrhZII2LnDcclwd4K5W51osjxfBCM7E76Ck7EDG4YHEESAesXZBgrSrHDQNAjGPv1VgOi-zkFi1biZSQzeaEbS3xch ) [data] =&gt; Array ( [message] =&gt; Koimute [] =&gt; ) ) 1 Result: Unauthorized Error 401 </code></pre> <p>So this means that it is being basically stopped from getting to the phone I think.</p> <p>UPDATE: Ok so I have been working at it and have tried to change the cert around and fool with the settings. now my console is printing out that I am connected to the GCM. But, still I do not receive any notification from the server at all. Here is what my console is printing</p> <pre><code>0028-05-24 12:21:32.829: GCM | GCM library version 1.1.4 0028-05-24 12:21:32.841: GCM | Invalid key in checkin plist: GMSInstanceIDDeviceDataVersion 2016-05-24 12:21:32.856 MyApp[560:] &lt;GMR/INFO&gt; App measurement v.2003000 started 2016-05-24 12:21:32.857 MuApp[560:] &lt;GMR/INFO&gt; To enable debug logging set the following application argument: -GMRDebugEnabled 0028-05-24 12:21:32.920: GCM | Invalid key in checkin plist: GMSInstanceIDDeviceDataVersion 2016-05-24 12:21:33.053 MyApp[560:106171] INFO: GoogleAnalytics 3.14 -[GAIReachabilityChecker reachabilityFlagsChanged:] (GAIReachabilityChecker.m:159): Reachability flags update: 0X000002 Registration Token: My token i get from GCM 2016-05-24 12:21:33.067 MyApp[560:] &lt;GMR/INFO&gt; App measurement enabled Connected to GCM 2016-05-24 12:21:33.937 MyApp[560:106213] INFO: GoogleAnalytics 3.14 -[GAIBatchingDispatcher hitsForDispatch] (GAIBatchingDispatcher.m:368): No pending hits. </code></pre> <p>The GCM | Invalid key in checkin plist: GMSInstanceIDDeviceDataVersion error from what I gathered means that it is working and is fine. They said that they will fix this in a later release</p> <p>OLD: So I have set up the GCM as well as a Google Analytics in my iOS project. The Analytics works perfect and all. Thats why I don't think its my Google service json that is the problem. I can successfully register to receive a token from the GCM server. But when I try to send a push notification nothing happens. I do receive a notification when it registers successfully so I think that my notification centre is working too. I follows the steps for creating the certificates as well. So I do not know where the problem is.: I am also using a third party APNs tester to rule out my server being the issues. I am using APN Tester. The APN tester returns this from doing a push notification:</p> <pre><code>gateway.sandbox.push.apple.com:2195 2016-05-23 07:56:02 +0000: Connected to server gateway.sandbox.push.apple.com 2016-05-23 07:56:02 +0000: Set SSL connection 2016-05-23 07:56:02 +0000: Set peer domain name gateway.sandbox.push.apple.com 2016-05-23 07:56:02 +0000: Keychain Opened 2016-05-23 07:56:02 +0000: Certificate data for Apple Development IOS Push Services: com.mywebpage.jp.MyClient initialized successfully 2016-05-23 07:56:02 +0000: Sec Identity created 2016-05-23 07:56:02 +0000: Client certificate created 2016-05-23 07:56:03 +0000: Connected 2016-05-23 07:56:03 +0000: Token: &lt;0000000c 00000003 00001bff ff1b0000 00001bff ff1b0000 00001bff ff1b0000 00001bff ff1b0000 00001bff 00000e82 000000ef 0000003a 3a000000 0000003a 3a000000 0000003a 3a000000&gt; 2016-05-23 07:56:03 +0000: Written 92 bytes sending data to gateway.sandbox.push.apple.com:2195 2016-05-23 07:56:03 +0000: Disconnected from server gateway.sandbox.push.apple.com:2195 </code></pre> <p>This is my AppDeligate file</p> <pre><code>import UIKit import Foundation @UIApplicationMain //add this for GCM //, GGLInstanceIDDelegate, GCMReceiverDelegate class AppDelegate: UIResponder, UIApplicationDelegate, GGLInstanceIDDelegate, GCMReceiverDelegate{ let loginInformation = NSUserDefaults.standardUserDefaults() var window: UIWindow?; //MARK: Varaibles for GCM var connectedToGCM = false var subscribedToTopic = false var gcmSenderID: String? var registrationToken: String? var registrationOptions = [String: AnyObject]() let registrationKey = "onRegistrationCompleted" let messageKey = "onMessageReceived" let subscriptionTopic = "/topics/global" func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -&gt; Bool { // Override point for customization after application launch. APIManager.sharedInstance.setAuthorization(Config.API_USERNAME, password: Config.API_PASSWORD) // [START_EXCLUDE] // Configure the Google context: parses the GoogleService-Info.plist, and initializes // the services that have entries in the file var configureError:NSError? GGLContext.sharedInstance().configureWithError(&amp;configureError) assert(configureError == nil, "Error configuring Google services: \(configureError)") gcmSenderID = GGLContext.sharedInstance().configuration.gcmSenderID // [END_EXCLUDE] // Register for remote notifications let settings: UIUserNotificationSettings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil) application.registerUserNotificationSettings(settings) application.registerForRemoteNotifications() // [END register_for_remote_notifications] // [START start_gcm_service] let gcmConfig = GCMConfig.defaultConfig() gcmConfig.receiverDelegate = self GCMService.sharedInstance().startWithConfig(gcmConfig) // [END start_gcm_service] //Google Analyitics functions // [START tracker_swift] // Configure tracker from GoogleService-Info.plist. //var configureGAError:NSError? GGLContext.sharedInstance().configureWithError(&amp;configureError) assert(configureError == nil, "Error configuring Google services: \(configureError)") // Optional: configure GAI options. let gai = GAI.sharedInstance() gai.trackUncaughtExceptions = true // report uncaught exceptions gai.logger.logLevel = GAILogLevel.Verbose // remove before app release // [END tracker_swift] return true } func applicationDidEnterBackground(application: UIApplication) { GCMService.sharedInstance().disconnect() // [START_EXCLUDE] self.connectedToGCM = false // [END_EXCLUDE] } func applicationDidBecomeActive(application: UIApplication) { // Connect to the GCM server to receive non-APNS notifications GCMService.sharedInstance().connectWithHandler({(error:NSError?) -&gt; Void in if let error = error { print("Could not connect to GCM: \(error.localizedDescription)") } else { self.connectedToGCM = true print("Connected to GCM") } }) } // [START receive_apns_token] func application( application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData ) { // [END receive_apns_token] // [START get_gcm_reg_token] // Create a config and set a delegate that implements the GGLInstaceIDDelegate protocol. let instanceIDConfig = GGLInstanceIDConfig.defaultConfig() instanceIDConfig.delegate = self // Start the GGLInstanceID shared instance with that config and request a registration // token to enable reception of notifications GGLInstanceID.sharedInstance().startWithConfig(instanceIDConfig) registrationOptions = [kGGLInstanceIDRegisterAPNSOption:deviceToken, kGGLInstanceIDAPNSServerTypeSandboxOption:true] GGLInstanceID.sharedInstance().tokenWithAuthorizedEntity(gcmSenderID, scope: kGGLInstanceIDScopeGCM, options: registrationOptions, handler: registrationHandler) // [END get_gcm_reg_token] } // [START ack_message_reception] func application( application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) { print("Notification received: \(userInfo)") // This works only if the app started the GCM service GCMService.sharedInstance().appDidReceiveMessage(userInfo); // Handle the received message // [START_EXCLUDE] NSNotificationCenter.defaultCenter().postNotificationName(messageKey, object: nil, userInfo: userInfo) // [END_EXCLUDE] } func application( application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler handler: (UIBackgroundFetchResult) -&gt; Void) { print("Notification received: \(userInfo)") // This works only if the app started the GCM service GCMService.sharedInstance().appDidReceiveMessage(userInfo); // Handle the received message // Invoke the completion handler passing the appropriate UIBackgroundFetchResult value // [START_EXCLUDE] NSNotificationCenter.defaultCenter().postNotificationName(messageKey, object: nil, userInfo: userInfo) handler(UIBackgroundFetchResult.NoData); // [END_EXCLUDE] } // [END ack_message_reception] func registrationHandler(registrationToken: String!, error: NSError!) { if (registrationToken != nil) { self.registrationToken = registrationToken print("Registration Token: \(registrationToken)") //store the registation token for use in the postData function in the login page self.loginInformation.setObject(self.registrationToken, forKey: "GCMToken") self.loginInformation.synchronize() let userInfo = ["registrationToken": registrationToken] NSNotificationCenter.defaultCenter().postNotificationName( self.registrationKey, object: nil, userInfo: userInfo) } else { print("Registration to GCM failed with error: \(error.localizedDescription)") let userInfo = ["error": error.localizedDescription] NSNotificationCenter.defaultCenter().postNotificationName( self.registrationKey, object: nil, userInfo: userInfo) } } // [START on_token_refresh] func onTokenRefresh() { // A rotation of the registration tokens is happening, so the app needs to request a new token. print("The GCM registration token needs to be changed.") GGLInstanceID.sharedInstance().tokenWithAuthorizedEntity(gcmSenderID, scope: kGGLInstanceIDScopeGCM, options: registrationOptions, handler: registrationHandler) } // [END on_token_refresh] // [START upstream_callbacks] func willSendDataMessageWithID(messageID: String!, error: NSError!) { if (error != nil) { // Failed to send the message. } else { // Will send message, you can save the messageID to track the message } } // [START receive_apns_token_error] func application( application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError ) { print("Registration for remote notification failed with error: \(error.localizedDescription)") // [END receive_apns_token_error] let userInfo = ["error": error.localizedDescription] NSNotificationCenter.defaultCenter().postNotificationName( registrationKey, object: nil, userInfo: userInfo) } func didSendDataMessageWithID(messageID: String!) { // Did successfully send message identified by messageID } // [END upstream_callbacks] func didDeleteMessagesOnServer() { // Some messages sent to this device were deleted on the GCM server before reception, likely // because the TTL expired. The client should notify the app server of this, so that the app // server can resend those messages. } //MRAK: End of GCM Function func applicationWillTerminate(application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } func applicationWillEnterForeground(application: UIApplication) { // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. } func applicationWillResignActive(application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. } } </code></pre> <p>And this is my testing page where it receives the notification of a successful registration:</p> <pre><code>class PlayGroundController: UIViewController{ @IBOutlet weak var registeringLabel: UILabel! @IBOutlet weak var registrationProgressing: UIActivityIndicatorView! override func viewDidLoad() { super.viewDidLoad() let appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(PlayGroundController.updateRegistrationStatus(_:)), name: appDelegate.registrationKey, object: nil) NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(PlayGroundController.showReceivedMessage(_:)), name: appDelegate.messageKey, object: nil) registrationProgressing.hidesWhenStopped = true registrationProgressing.startAnimating() } func updateRegistrationStatus(notification: NSNotification) { registrationProgressing.stopAnimating() if let info = notification.userInfo as? Dictionary&lt;String,String&gt; { if let error = info["error"] { registeringLabel.text = "Error registering!" showAlert("Error registering with GCM", message: error) } else if let _ = info["registrationToken"] { registeringLabel.text = "Registered!" let message = "Check the xcode debug console for the registration token that you " + " can use with the demo server to send notifications to your device" showAlert("Registration Successful!", message: message) } } else { print("Software failure. Guru meditation.") } } func showReceivedMessage(notification: NSNotification) { if let info = notification.userInfo as? Dictionary&lt;String,AnyObject&gt; { if let aps = info["aps"] as? Dictionary&lt;String, String&gt; { showAlert("Message received", message: aps["alert"]!) } } else { print("Software failure. Guru meditation.") } } func showAlert(title:String, message:String) { //Set up for the title color let attributedString = NSAttributedString(string: title, attributes: [ NSFontAttributeName : UIFont.systemFontOfSize(15), //your font here, NSForegroundColorAttributeName : UIColor.whiteColor() ]) //Set up for the Message Color let attributedString2 = NSAttributedString(string: message, attributes: [ NSFontAttributeName : UIFont.systemFontOfSize(15), //your font here, NSForegroundColorAttributeName : UIColor.whiteColor() ]) let alert = UIAlertController(title: title,message: message, preferredStyle: .Alert) alert.setValue(attributedString, forKey: "attributedTitle") alert.setValue(attributedString2, forKey: "attributedMessage") //alert.view.tintColor = UIColor.whiteColor() let dismissAction = UIAlertAction(title: "Dismiss", style: .Destructive, handler: nil) alert.addAction(dismissAction) self.presentViewController(alert, animated: true, completion: nil) //set the color of the Alert //let subview = alert.view.subviews.first! as UIView //let alertContentView = subview.subviews.first! as UIView //alertContentView.backgroundColor = UIColor.blackColor() let subview :UIView = alert.view.subviews.last! as UIView let alertContentView = subview.subviews.last! as UIView alertContentView.backgroundColor = UIColor.blackColor() //alertContentView.backgroundColor = UIColor.greenColor() //Changes is to a grey color :( /* alertContentView.backgroundColor = UIColor( red: 0, green: 0, blue: 0, alpha: 1.0) //Also another Grey Color Not batman black */ //alertContentView.backgroundColor = UIColor.blueColor() //turns into a purple } override func preferredStatusBarStyle() -&gt; UIStatusBarStyle { return UIStatusBarStyle.LightContent } deinit { NSNotificationCenter.defaultCenter().removeObserver(self) } </code></pre>