Pushing notification from smartphone to smartwatch - android

I'm developing an application where the user can create his own tasks and then he gets a notification when the time comes. So my question is how to push these notifications to his smartwatch? do I really need to code something or just write some wearable features and then synchronize them by using Bluetooth?

You don't need to code anything Android Wear specific. Just use the NotificationCompat.Builder to build your notification on your phone and it will show up on your Android Wear device.

Related

Want to Block Notification in a iOS App when the device is in lock state using Firebase?

I have developed a chat App in Android using Firebase which has the concept of blocking push notification when my device is in lock condition. For this feature, I required to implement Foreground service because as soon as the user unlocks his device, the device receives the blocked notifications or all the blocked chat messages.
Now, I want to develop the iOS version of this App using the same Firebase but I'm not sure if I can hold the notification like the Android if my iOS device is in lock condition (with App not running in the background). So, is this feature is feasible in iOS and if yes then how I can achieve this ?
Thanks in advance
From my research, you used to be able to register for a specific Darwin notification, com.apple.springboard.lockstate . However, Apple is rejecting apps for this practice as the API is not public.
If you could explain why you’re attempting to catch notifications while the device is locked.
A thought: perhaps a silent push could be of benefit.

Show notification only on phone (not on Android Wear)

Is there any way to prevent a notification be shown on Android Wear device? I know it's possible by using setOngoing(true) but I don't want my notification to be ongoing.
you should call setLocalOnly(true) on the NotificationCompat.Builder.
From the documentation
Set whether or not this notification should not bridge to other
devices.
you can read more here

Open corresponding app on Handheld without notification from Android Wearable (Gear live)

I would like to develop an app on the wearable wich should be able to launch an app on my Handheld device, without the notification standard ("open on device") action.
It should start the app on the handheld, even if the Handheld App is closed at the moment. Is there a solution to achieve this. I can't find it in the documentation.
If I overread that in the official doc., please post a link.
To do that, you have to use the Wearable Data Layer API.
Just send a message using the Message API from the Android Wear device to the handheld's one. The WearableListenerService of your handheld app can then launch an Intent to open the app.

Read existing notifications on Android

How can I read existing notifications on Android? I want to be able to grab all the pending/existing notifications, parse them, and try to grab any information them. For instance, if my device had notifications from an SMS app, then I want to be able to read whatever information I could (if possible) from the notification. Is this possible?
Note that I am NOT asking for an active notification listener/receiver. I just want to be able to parse existing notifications on-demand.
Thanks in advance!
On devices with Android 4.3 and newer (API level 18) it is possible to use the NotificationListenerService and its function getActiveNotifications() to get a list of all outstanding notifications visible to the user. You can also react on each new notification by using onNotificationPosted.
On older devices, the only way to get access to the android notifications is to implement an AccessibilityService to react on incoming TYPE_NOTIFICATION_STATE_CHANGED-events.

Creating Wearable notifications without the builder?

Is it possible to create wearable notifications without using the notification builder?
I already create a notification via new Notification on newer devices and would like to keep that code and still add the Wearable notification to my existing one. Is this possible, or is everything connected to the builder helper class for now?
It seems that there is no WearableNotifications.Builder class anymore in the newest SDK.
But you need to do nothing to simply let your Notification show on Android Wear Devices.
If you want to have a slightly better look for your Notifications you can use WearableExtender to add Android Wear specific actions, pages and layout options.
The WearableNotifications.Builder class is only needed if you want to add 'wearable extensions' to your notification. The normal notifications shown by your app are displayed also on the wearable connected to your device without any further integration work.

Categories

Resources