How to use a WatchKit Services Certificate? - ios

Recently, Apple has introduced "WatchKit Services Certificate" to its development portal. From the description below, it appears to allow users to leverage push notifications to update Watch Complications directly. But, the CLKComplicationDataSource protocol contains no information how how to implement this. Does anyone have any further information on this?
From Apple's Developer site:
"Establish connectivity between your notification server, the Apple Push Notification service sandbox, and production environment to update ClockKit complication data. When utilizing HTTP/2, the same certificate can be used to deliver app notifications, update ClockKit complication data, and alert background VoIP apps of incoming activity. A separate certificate is required for each app you distribute."
No one knows on the Apple forums:
https://forums.developer.apple.com/thread/19594
CLKComplicationDataSource Protocol Reference
https://developer.apple.com/library/watchos/documentation/ClockKit/Reference/CLKComplicationDataSource_protocol/
More documentation, but no implementing details:
http://images.apple.com/certificateauthority/pdf/Apple_WWDR_CPS_v1.13.pdf
Thanks for any help you can provide!

Checkout the WWDC 2015 video called Introducing Watch Connectivity. Take a look at about minute 50. This describes how you go about registering your complication for push notifications using PushKit. It doesn't go into detail about using a WatchKit Services Certificate, so I would try to use the normal iOS Push Notification certificate to actually send the notifications first, and if that doesn't work try sending the same message using the WatchKit Services Certificate instead.

Related

Push Notifications without Apple Push Notification Service?

Can one use a 3rd party service to send Push Notifications without relying on the Apple Push Notification Service (APNS)?
If it is a requirement that one use the APNS service, is it simply a requirement for App Store approval or is it a technological limitation?
I have seen other questions, such as this one: Apple push notification without Apple Server, but it mainly deals with sending files and is several years old.
Apple requires you to use APNS to send push notifications to devices. This cannot be done without APNS, if you found a way around this then Apple would most likely reject the app.
Click here to read the documentation. When you register for push notifications you are actually getting the device token for your app on that specific device from APNS, therefore that is an APNS specific token and you will need to use APNS to send the notification.

APN push notifications for chat

I'm trying to add notifications to a private chat app that uses Firebase, unfortunately Firebase has an APN service but it must be configured and needs also a server app to manage it. I'd like to have the user notified when someone is texting him while the app is in the background. The problem is that APN (Apple Push Notifications) requires a server with a certificate and that is ok with me, but I'm looking for a way to send push notifications from an iOS device to another device, I mean device-to-device push notifications and the server has just to relay the messages as they are. In my case the APN server should only relay the messages that it receives from a source device to the destination device. I couldn't find a way to obtain that without writing sever code. I want to use pre-built existing services. Has anybody any idea on how to send push notifications from one device to another without configuring and writing server apps? I tried a workaround using the background fetch iOS feature, but the system si randomly giving my app execution time... and that means that my app could wait hours before being started by the system... so that is not a viable solution. Please help
Ok, probably what I found out could be helpful for others. Actually
what I'm looking for can be directly integrated in the app. You need a library like NWPusher (free on GitHub) which can be imported, and with just a few lines of code and the APN device token you get from the system, it is possibile to implement APN notifications... easily, but most importantly... for free.
UPDATE
Check also APNS framework on GitHub. It's written in Swift 3.0 and it supports the latest features.
You are essentially looking for a messaging / chat API to handle device-to-device communication. You might want to try Pusher or PubNub

Apple rejection after implementing silent notifications with PushKit

We added silent notifications which require PushKit and enabling VoIP in the Info.plist
See Apple's PushKit Doc
Now my app is rejected by Apple:
Your app declares support for VoIP in the UIBackgroundModes key in your Info.plist, but does not include any Voice over IP services.
Please revise your app to either add VoIP features or remove the "voip" setting from the UIBackgroundModes key.
The app is NOT a VoIP therefore it doesn't require VoIP features.
Removing the VoIP from UIBackgroundModes causes the silent notifications to stop working.
Anyone know what I should do?
What VoIP feature can I add (even if I dont use it, just to pass the review)?
I asked Apple but they got back with an auto generated response with the same rejection reason.
You should likely be using iOS Service Extensions to decrypt the message.
https://developer.apple.com/reference/usernotifications/unnotificationserviceextension
You use this extension to modify the notification’s content or download content related to the extension. For example, you could use the extension to decrypt an encrypted data block or to download images associated with the notification.
You can also learn more about how this works at this WWDC talk.
https://developer.apple.com/videos/play/wwdc2016/707/
Implementing VoIP features to do this is complete overkill.
Update on the resolution -
We installed a third party VoIP solution and implemented VoIP calls in our app. Awkward to be forced to add a feature but in our case it was right for our app.
In iTunesConnect submission page, under "App Review Information" "Notes" I had to state that we added a new feature VoIP calls, with steps to test VoIP calls.
This caught the reviewers attention to the new VoIP call feature and the app passed.
When I added the new feature under "whats new in this version", the app continued to get rejected.
We have also faced same issue -
You can't use voip background mode unless you implement voip
features.
Just implement IM(chat) feature in your app then you will be capable to publish your
app at Appstore.
Good luck!

GCM in iOS - clarification

Just wanted to conform if my understanding is correct. As per my understanding, the mechanism involved in delivering the push notification to iOS App is Server -> GCM -> APNS -> iOS App. I am an iOS developer and I know that Apple strictly never allows a server other than APNS server to send a remote notification to iOS App. So, just wanted to know whether the notification is directly pushed to the iOS App from GCM or, via APNS.
Push messages are always sent by APNS.
What services like Google Cloud Messaging or Parse.com do is facilitating the administration of push messages - eg enabling an app to switch pushon or off for an app, or group users so you can send push messages to certain user groups instead of all of them.
GCM is not involved in Push Notification in iOS.
It is carried out through APNS.
Please refer
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html
It will clear all your doubts.
Everything will be clear if you just look at image:
Its showing complete APNS process. This is the process for iOS, no GCM included for iOS.

Send push notifications to Apple devices without connecting to APNS

I know this question can sound a bit strange, but I want to ask this anyway (feel free to downvote): is it possible to send push notifications to an iOS device without connecting to an Apple server? My idea is to send a push from my private server, not Apple's. Is this possible?
Info from developer.apple.com
Remote notifications—also known as push notifications—arrive from
outside a device or a Mac. They originate on a remote server—the app’s
provider—and are pushed to apps on devices (via the Apple Push
Notification service) when there are messages to see or data to
download.
There is no way to do it without using Apple Push Notification System (apns).
Well, the general answer would be - no.
It is not possible due to Apple's restrictions.
There may be different providers to an APN, but as the documentation suggests, there has to be a direct connection to an APN.
For more informations, please check out Apple's Documentation on Apple Push Notification Service.
However, I found this post where a user suggests using a service called Urban Airship - I have not tried this myself, so I don't know if and how it would work, but you may check it out :)

Resources