Our app has quite a few notification scenarios on the iPhone App which might not make sense for the Watch App. I investigated the Watch documentation to check whether notifications can be Apple Watch specific, but did not find any details. Is didReceiveRemoteNotification in the Watch code the best way to decide whether to surface a notification on the Watch?
The OS decides where to surface the notification. You have no control over it. Your iOS/Watch app can only respond if it's the lucky recipient.
No, at least for now (iOS 8.3 + Watch OS 1.0).
The phone app and its watch extension is essentially the same app. iOS will decide which notification should be presented on which device. The 3rd party app developers have zero control over this. Users can choose if all notifications from single apps are allowed to be shown on the watch.
The basic logic is: Notifications will be only delivered to the watch when the paired iPhone is locked, the screen is off, and the watch is on the wrist.
Related
I am developing an instant messaging application and this application has a feature of making a phone call, like in other messaging applications such as WhatsApp, Signal, Telegram etc. However, when someone makes a call to me, the notification of the call screen does not show on my Apple Watch. Like so;
Apple Watch Call Screen
How can I overcome this issue?
Thanks in advance.
I host a PWA website and I am trying to integrate push notifications to my users who may have the website open in a browser tab even if their phones are inactive. You notoriously can't send Push notifications to iPhones without using Apple Push Notifications service (APNs).
Seeing as the point of firebase cloud messaging (FCM) is to outsource the message handlers, I kinda assumed it would support sending push notifications to iPhones somehow via APNs, but the information here suggests you still can't do this from the web.
https://firebase.google.com/docs/cloud-messaging/js/client
Safari and iPhones don't support Push API.
According to this answer: https://stackoverflow.com/a/64576541/2116253
Option #2 may be possible if you know the device ID token, which is apparently very hard to get and perhaps not possible anymore because Apple are trying to make it harder to obtain due to security concerns.
I think the actual sending via APNs from server side is quite easy, the problem comes with the initial setup/registration and actually granting permissions that allow notifications to arrive.
So, in short, I don't mind registering my website with Apple, agreeing to terms and obtaining keys for the purpose of interfacing with APNs, but I don't want to make and distribute a whole native iOS app just to send notifications to devices about my website.
Does anybody know the correct way to achieve this in 2022 ?
I have a xamarin forms project that uses an azure mobile service with offline sync. The iOS client is working perfectly in that it can save things locally and sync in the background. The context of my app is a game scorekeeper. So, there are two players involved both scoring on the single device.
What I would like to happen is for the "visiting" player or the player who doesn't own the device in use (ie not the primary user) to have their device sync when new data is pushed from the device in use.
Device A pushes new content, Device B somehow knows to pull new content.
This could open the door for each player to score on their own devices in a future version.
Anyway, the question is how do I tell device B to pull? Do I use APN type notification and that triggers a sync, or SignalR to tell it to sync?
The best approach on sync scenarios like this is to have your background sync process going at set intervals but then also trigger your sync process from a specific Push Notification.
If you send a Push Notification with a "special" payload (i.e. meaning something that just means to sync to your code). Then start the sync once the device receives that.
This article might help with Azure Push Notifications with Xamarin Forms: http://www.xamarinhelp.com/push-notifications/
The idea of using the push notifications is only to have a notification mechanism that will send a notification when there is a new message waiting to download from the backend service: all the notifications are of the same type e.g. "refresh messages from the server" (the same for Android and iOS).
Are there any limits for the Apple/Google push notifications services?
Assuming that my application will handle more that 100k active users (or even 1M or more users) - would there be any problem with the Apple Push Notifications or GCM services?
If using the push notifications for such a service is not a good idea then what is other solution that could be used for mobile chat applications?
Don't forget that on iOS user may forbid sending notifications, so your app won't receive any even in foreground. Thus, you need to implement your own push mechanism.
Need for push notifications
Especially on iOS you don't have a choice but to use their push notifications service APNS. There is no other way to receive notifications immediately because iOS may kill or neglect the TCP connections of your background app.
On Android it seems possible to use your own background TCP connection to avoid having to use push notifications. But you may still consider the use of the push notifications through GCM for the sake of improved battery usage.
Pricing
Neither APNS (iOS) nor GCM (Android) charge you for the service and you are allowed to send an unlimited number of messages.
Limitations and Requirements
Both services will delete message, when there are too many messages accumulated in the queue for an offline device - which makes sense because there is no point in delivering those messages hours later. You have to take that in to account, when writing your app (just do a poll when going back online).
Depending on the app you are writing, there may also be privacy concerns. Even if you encrypt the message itself, at least Apple/Google know when a notification is sent to a certain device, which may be a deal-breaker for certain high-security applications.
You will also need a server that is able to communicate to both APNS and GCM. There are open source solutions for that (e.g. easyApns for iOS and python-gcm for Android), but how easy their integration is depends on your server and the language it is written in.
Does flex mobile supports In-App purchases, push notification etc that can run on all supported mobile platforms (iOS, Android, Blackberry playbook).
Thanks
Currently "all" native mobile features are "supported" via AIR native extensions.
You can read about AIR native extensions here
It is quite a new feature, but the point is, you can create bridge between native code SDK and your AIR application. It means, your application will be able to make calls to native SDK, and also receive events from native SDK.
Basically, if you want to present native feature in your Flex/AIR application, you create native code to achieve what you want (does require only little coding in most cases), bridge it with ActionScript interface, and package it as .ane (air native extension). This extension behaves like actionscript library you can then reuse for all your Flex projects if interested.
Link mentioned above also presents some examples - native notification is amongst them...
Since its fairly new feature, there are only few examples presented, but its not hard to code your own native extension for native feature you want - i did it myself and it worked... (here is simple native extension tutorial)
So the result is - you can present any native feature in your Flex app, as long as you have native extension for it...
Does flex mobile supports In-App
purchases,
Not integrated with the native store "procedures". I hear you can "build your own" using PayPal w/o much trouble; but It is not something I've personally investigated.
push notification
Yeah, it should. As long you're connecting to a server that supports push notifications. BlazeDS and GraniteDS use long polling to accomplish this. WebORB and LiveCycle use RTMP.
It's hard to quantify what "etc" may mean.
A note on Apple push notifications to clear up an apparent misconception from www.Flextras.com: Apple does not allow apps to bypass APNS and implement their own push notification service. Please see point 5.1 below.
From https://developer.apple.com/appstore/resources/approval/guidelines.html#push-notifications:
5. Push notifications
5.1 Apps that provide Push Notifications without using the Apple Push
Notification (APN) API will be rejected
5.2 Apps that use the APN service without obtaining a Push Application ID from
Apple will be rejected
5.3 Apps that send Push Notifications without first obtaining user consent will
be rejected
5.4 Apps that send sensitive personal or confidential information using Push
Notifications will be rejected
5.5 Apps that use Push Notifications to send unsolicited messages, or for the
purpose of phishing or spamming will be rejected
5.6 Apps cannot use Push Notifications to send advertising, promotions, or direct
marketing of any kind
5.7 Apps cannot charge users for use of Push Notifications
5.8 Apps that excessively use the network capacity or bandwidth of the APN
service or unduly burden a device with Push Notifications will be rejected
5.9 Apps that transmit viruses, files, computer code, or programs that may harm
or disrupt the normal operation of the APN service will be rejected
I am currently using this open source iOS ANE to implement in-app purchases in Flex:
http://code.google.com/p/in-app-purchase-air-ios/wiki/APIDescription
There is a push notification ANE (both Android and iOS) as well that I'm currently investigating, although it may not support remote notifications:
http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/notification.html
This iOS-only ANE for push notifications is open source:
http://flashsimulations.com/2011/12/16/apple-push-notification-service-native-extension-for-adobe-air/