swift - Instant Message Push Notification Using Sinch not coming on iOS -
[![enter image description here][1]][1]i've mentioned fields still i'm not getting push notification. code:
firstly in didfinishlaunchingwithoptions call this:
self.push = sinch.managedpushwithapsenvironment(.production) self.push?.delegate = self self.push?.setdesiredpushtypeautomatically() client = sinch.clientwithapplicationkey("xxxxxx", applicationsecret: "xxxxxxx", environmenthost: "sandbox.sinch.com", userid: userid) client?.delegate = self client?.setsupportmessaging(true) client?.setsupportpushnotifications(true) client?.enablemanagedpushnotifications() client?.start() client?.startlisteningonactiveconnection() self.push?.registerusernotificationsettings() func managedpush(managedpush: sinmanagedpush!, didreceiveincomingpushwithpayload payload: [nsobject : anyobject]!, fortype pushtype: string!) { self.client?.relayremotepushnotification(payload) } func application(application: uiapplication, didregisterforremotenotificationswithdevicetoken devicetoken: nsdata) { let tokenchars = unsafepointer<cchar>(devicetoken.bytes) var tokenstring = "" in 0..<devicetoken.length { tokenstring += string(format: "%02.2hhx", arguments: [tokenchars[i]]) } self.push?.application(application, didregisterforremotenotificationswithdevicetoken: devicetoken) } func application(application: uiapplication, didreceiveremotenotification userinfo: [nsobject : anyobject]) { self.push?.application(application, didreceiveremotenotification: userinfo) }
i've uploaded push certificate in sinch dashboard.
may know missing in code might reason i'm not getting push.
edited:
here image of uploaded push distribution certificate on sinch dashboard.
you should not have client?.setsupportpushnotifications(true) thats when want handle push self