Search Unity

Tizen - Local notification with delay

Discussion in 'Tizen' started by IceCatGames, Apr 28, 2017.

  1. IceCatGames

    IceCatGames

    Joined:
    Mar 22, 2016
    Posts:
    33
    Hello,
    I've meet a problem when trying implement delayed local notifications in my game for Tizen. I want the following logic - after 24 hours of game was last played, game should show local notification for user. As I understand, I should make these steps:
    1) On application pause or quit I should make Alarm with 24 hours delay
    2) When alarm will trigger I should handle it and show push notification
    First step works perfectly, but I can't find a way to handle application control structure from alarm in my own method without starting the whole application. As I understand, event listener for new application control objects sets in Unity generated code (in main function) and I can't change or intercept it. Without it, I can't make any specific logic for different application controls in my application.
    Am I right or may be other way to resolve my problem exists?
     
  2. sukwon-suh

    sukwon-suh

    Joined:
    Mar 31, 2015
    Posts:
    81
  3. IceCatGames

    IceCatGames

    Joined:
    Mar 22, 2016
    Posts:
    33
  4. sukwon-suh

    sukwon-suh

    Joined:
    Mar 31, 2015
    Posts:
    81
    I'm looking into the issue.
     
  5. sukwon-suh

    sukwon-suh

    Joined:
    Mar 31, 2015
    Posts:
    81
    There is a way to make Service Application for notification alarm.
    I'll try to register a service application with Unity TPK on the TIZEN STORE.
     
  6. sukwon-suh

    sukwon-suh

    Joined:
    Mar 31, 2015
    Posts:
    81
    I made alternative.
    This use Timer and elm_win_lower methods.
    elm_win_lower makes application going to background instead terminating application.
    So if application closed by user or system, it doesn't work.
     

    Attached Files:

  7. IceCatGames

    IceCatGames

    Joined:
    Mar 22, 2016
    Posts:
    33
    @sukwon-suh
    Thanks! I'll investigate this way and check if it's possible to use in my case.
     
  8. sukwon-suh

    sukwon-suh

    Joined:
    Mar 31, 2015
    Posts:
    81
    I found the way to make service application with Unity game of Tizen. This will be perfect solution of Notification.
    I'll update it on Monday.
     
  9. sukwon-suh

    sukwon-suh

    Joined:
    Mar 31, 2015
    Posts:
    81
    I made some example code. This application can be worked if game is not running.
    And I used 2.3 public APIs only. But this is a little complicated.

    1. Unity game writes a file with notification data and launch service application with plugin(libnotiservicerun.so).
    2. Then service application use System Alarm service from the file, finally notification will show on service application.
    3. If end user touch notification, then Unity will be launch.

    TizenAlarmNotification.zip : Unity Project file : Main TPK
    notiservicerun.zip : Tizen project file : libnotiservicerun.so
    notiservice.zip : Tizen project file : noti alarm service Sub TPK

    And you have to combine two packages to one package before registering TIZEN STORE with command below.

    tizen package -t tpk -s <security profile> -r <sub tpk> -- <main tpk>

    e.g.
    C:\tizen-studio\tools\ide\bin\tizen.bat package -t tpk -s "s" -r "C:\Users\sukwonlaptop\workspace\notiservice\Debug\com.unity.notiservice-1.0.0-arm.tpk" -- "D:\Unity\Projec
    t\TizenAlarmNotification\s.tpk"

    I'll try to register this service sample to UNITY Asset Store after refactoring.

    Thank you.
     

    Attached Files: