SWIFT PUSH Notification Problem(HELP)

HI i have successfully followed the documentation.

But when i added this functions, my app hangs, when i remove this my app works.
any idea? did i miss something?
Note: i just copy and paste from your docu, it has typo hope you fix it soon(2months ago someone comment on that still no action).

func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) { backendless.sahredInstance().messaging.registerDeviceToken(deviceToken)} func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) { // handle error}

on the first launch of my app, everything works fine, but when i relaunch it again, it hangs. its like, its registering again on the Push Notification Server or something, but it detects a registration exist. No crash logs appear on actual device.

Hi Joey,

You could investigate our sample project for push notification (see in attachment) - how it have to be organized. Load it with TestPushNotify.xcworkspace.

You could try it with your Bundle Identifier and your Backendless app (you need to create the proper .p12 certificate and provisioning profile, as this is described in a doc).


TestPushNotify.zip (19.55MB)

My setup is okay, i see it device registered to the backendless UI as default, i have tried the objC sample its working there together with my certificate and provisioning profile (notification reflects on the text view) not as a notification view(modal view). What i want is to receive a push notification from the server and appears on the app(any viewcontroller) when triggered(modal view notification). Do i need to add a textView and makes it modal view??

Also i have tried your sample swift from other thread and have this result:

didRegisterForRemoteNotificationsWithDeviceId: 35B19B71-D62C-329D-FF49-E991F186E600


Message has been sent: <MessageStatus> messageId: 4BDE4CE1-0E1C-E1A8-FFE3-7857D7EA0600, status: SCHEDULED errorMessage: (null)

RECEIVED: Optional(Tester) -> ONE

But how can i make it appear on the app(modal view notification)? let say sample notification, i waited for 10 minutes and does not pops up. hope to have a complete simple swift sample. So i could know the pattern.

Please add in attachment your sample project, which demonstrates the problem, i’ll investigate it.

Now i’ve manage to listen and make it work, i have converted the existing ObjC project to swift. And have output to string. Its now real time!.
i will just make my own local notification out of this, will try to experiment other options.

I found a problem about publish (i dont know if it is a BUG), lets say you have autologin(listens to user log session) on firstviewcontroller and also you have a REST API service wrapper working on background with dispatch and you also trigger publish via viewdidload, the app will hang(no crash just hang).

Please add missing part on documentation. About adding background on PLIST.