Local Notifications

Hey,

I know there exists a Push notification support in the SDK Box, but does cocos somehow support “local” notifications, for example show a notification if the user hasn’t played for 2 days and the app etc is closed.

I’ve seen lots of custom solutions to this, but nothing really directly from cocos.

We dont have anything built in. You could write you own though.

Probably only through Java(android) and obj-c (ios) i guess

would be interesting if the SDK box push notification libs, also support such local notfiications, not really sure what this is called, scheduling notifications probably, if anyone knows anything about this let me know

SDKBOX uses OneSignal, IIRC Have a look here: http://www.sdkbox.com/integrations

yeah i already took a look at onesignal but I only Can find push notification which are triggered somehow through the Server.

Haven’t found a way to schedule notification on the device as Background Service.

You mean a simple notification, which is triggered by alarm (specific time)? In Android there are no different words for push/local notification, because a push doesn’t automatically trigger a notification. A push triggers an intend and it’s up to you what to do: show notification, open app, delete contacts… And an alarm (in Android) also triggers an intend, where you can decide what to do. The only bad thing about an alarm is, that you have to add it after device reboot again, because they are not persisted.

Sorry, but I don’t know the iOS way of doing it, but I know the wording local notification from the iOS world.

ah ok.
I’ve just asked the OneSignal Team and they answered they don’t Support such local notifications, maybe in the future.

so I probably have to write it my self.
It should be possible to Create a Background Service which Auto starts on reboot, at least on Android.
So i in theory I just Need to save a timestamp for the last time the app was open and check for this in the Background Service and trigger a notification.

Please check this link, because since Android 8 an invisible background service isn’t possible anymore. As you can read on the page, it’s only for targetSDK 26, but the user can restrict it on the device also to older apps. And in my other post you can read, that all new/updated apps has to use targetSDK 26 from August/November 2018.

puh those are bad news :frowning:

does one of the sdkbox notifications support triggering notifications from code?
so I can at least manually trigger notifications while the game is open.