If Watch app opened before HealthKit accepted, show alert - watchkit

Was wondering what the best practice for this is.
If an app that used HealthKit is downloaded, and then the Watch app is started before the iPhone app, HealthKit will not have been allowed yet.
In that instance, the user is going to think the Watch app is broken because no totals or data will be updated, etc.
Is there a best way to avoid this or at least alert the user that you have done or seen?
I'm assuming I'd set some sort of bool that is set to false, and maybe put an alert up on the first screen of the Watch app until HealthKit has been allowed.

Related

Can I adjust the Firestore Listener Frequency?

I have a Flutter & Firebase app that provides users with price updates on the dashboard on the main screen. It does this with a Firestore Snapshot Listener, but my read count is flying through the roof (I'm at 203 reads and just 1 device is connected)... This info will only change once a month, and it really doesn't need to keep checking for updates at all times.
Is there a way to setup the listener so that it checks less frequently for updates? Or perhaps, can I setup a Firebase In-App Messaging system with which I send the price out and the app just saves and displays it?
Or is there any efficient solutions?
Since the Listener (which you do not show, so we can't even help you there) ONLY triggers when there is an update to the documents (NOT on a schedule) something is updating the collection you are listening to. 203 is not particularly high over a few days - how long has your app been running? Have you been restarting the app frequently? Most Listeners will give you a result at least once when you initialize them - i.e. when you start the app. There is no "long-term global memory" like that.
A listener will always receive updates as soon as they becomes available. This can't be configured. If you want a different update frequency, you should instead schedule that yourself within the app, and use get() to poll the database as often as you need. You can also use FCM on your backend to push updates to the app, if that works for your case.

How not to send FCM to users who don't want to receive push?

With GCM, when user expresses their preference whether they are willing to get notifications, we could mark their preference as active or inactive
How can I achieve similar effect with FCM?
When user says they don't want to receive pushes, we'd have to unsubscribe the user from all the topics we have?
Are there better approaches?
Depending on the scenario, unsubscribing from the topics is the way to go.
However, if your goal is to simply prevent the user from seeing any push notifications appearing on their screen, a workaround I could think of is have a setting (e.g. enable/disable notifications) that identifies if you should/shouldn't display a notification every time the user receives one.
For example, user installs the app. Initially, the setting defaults to enabled. Push notifications are displayed normally. If user disables it, when the device receives the message, you do not create a notification display.
For this to work, I'm thinking the checking should be done inside the method where you create the notification (e.g. sendNotification).
So the scenario now is that the device is still technically receiving the notification, it's just that you're not showing/displaying it to the user.
Note: I haven't tried to go with this scenario myself, so I'm not sure if this is breaking any best practices. I would still go with the unsubscribing if it were me though. It's easier.

How to programmatically exit Apple Watch app and return to watch face?

When a Push Notification is received on an Apple Watch, pressing the "dismiss" button dismisses the notification and returns to the watch face screen.
Within my Apple Watch app, I would like to implement a similar experience to a notification. That is, tapping an icon or selecting a "dismiss" menu item would close or background the app and return the user to the watch face.
This behavior would allow the user to quickly select a new option and go back to the watch face in a single action, without fiddling with the digital crown.
Is it possible, from within an app, to programmatically cause the watch to return to the watch face?
On iPhones, the iOS Human Interface Guidelines prohibit applications from closing programmatically, as "people tend to interpret this as a crash."
However, the user experience of the watch seems much more oriented around liberally and regularly returning to the watch face. Is it possible to quit or background an app programmatically and return to the watch face, without the user touching the digital crown?

Push Notification When App is closed/Quit including

Can anyone please so let me know precisely that how can I accomplish the task in which I need to show Push Notification to user when App is Quit/closed?
Currently, I am able to get the push notification done when App is running in background or opened. But App couldn't receive Notification when it is quit/closed by the user.
Right now, it's a really critical task on my shoulders. It's pretty clear do tell me in case if you guys need me to brief in details.
I am having a very hard time to believe that your scenario is Really the following:
When the app is either: open and in the foreground, or open and in the background, you are able to receive a notification to the device, and have its contents displayed in the app, but
When the app is quit (as in not running), the notification does not arrive to the device at all.
I have tested several devices and several push-enabled applications (event source, tag-based). The notification does arrive to the device, after the user subscribed to either a tag or by logging-in (in the case of event source-based), after which sending a notification always arrived to the device.
I don't understand this sentence:
my app logouts with the user
You need to be CLEAR in your explanation. Is there a logout button that the user clicks? If yes, are you also for some reason perform an unsubscribe API invocation? If no, edit the question and provide DETAILED, step-by-step reproduction instructions, AS WELL as provide your application, or any code that you use so that it could be inspected for possible issues.

Closing a Trigger.io forge mobile app via javascript (Android / iOS) - in order to apply Reload

Is it possible to ask a Trigger.io Forge mobile app to close itself through the forge JS api?
We're seeing users having problems with reloads:
We pop up a message when a reload is available, but it's difficult for us to explain that they have to
come out of the app
wait an unknown amount of time (for the reload update to download)
launch the app again
People either don't understand, or the force-quit the app meaning the reload doesn't download, or they come out and go straight back in before it's downloaded - and then see our 'reload' popup message immediately again.
I wondered if we could close the app for them if this would smooth things out a bit. Unless people have better suggestions for this user flow?
Are you listening for the updateReady events to pop up your message? If so, the Reload update has actually already been downloaded and is ready to go: all the user needs to do at that point is switch away from the app and back again; no delay required.
The only way to programmatically close a Trigger.io is in the backPressed event listener, which won't be of use to you in this situation.

Resources