Languages

Menu
Sites
Language
How to use NotifyByAppControl api
Hi,
 
I am developing a native application in which I am using  Tizen::Shell::NotificationManager api.
 
I want to use NotifyByAppControl api.
 
 
Objective -: I have a UI application and one service application.When the UI application is not running ,service application runs and hits one api call.Based on the response  of that api ,I want service application to Notify UI application.If the user taps the notification, I want to launch Ui application and at the same time a callback function inside UI application should get invoked.
 
For that, I have implemented  IAppControlProviderEventListener interface inside UI app class( the class which gets derived from Tizen::App::UiApp). 
 
Please explain me following things:
 
1>What are the 4 arguments that I need to pass to NotifyByAppControl .
2>Accordingly ,how should I configure manifest file of UI application.
 
Also let me know if there is anything extra I need to do.

Responses

5 Replies
Pushpa G
Q1.What are the 4 arguments that I need to pass to NotifyByAppControl. please check the online documents(https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.apireference%2FclassTizen_1_1Shell_1_1NotificationManager.html) and also check the "Resolving AppControls"(https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.appprogramming%2Fhtml%2Fguide%2Fapp%2Fresolving_appcontrols.htm) Q2. Accordingly ,how should I configure manifest file of UI application. A2> Please check the document - 'Exporting AppControl Functionality' https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.appprogramming%2Fhtml%2Fguide%2Fapp%2Fexporting_appcontrol_functionality.htm https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.native.appprogramming%2Fhtml%2Fguide%2Fapp%2Fexporting_appcontrol_functionality.htm And also check the sample application 'NotificationManager' in IDE>File>New>Project>Tizen>Tizen Native Project>Sample>NotificationManager For Q1 - File NotificationManagerTab1.cpp - find the below code section result r = __pNotificationManager->NotifyByAppControl(operation, &uri, &mime, &map, request); For Q2 - Open the manifest.xml file and you can see below description. audio/mp4 http://tizen.org/appcontrol/operation/notification_temporary mailto
amol sarmalkar
Thanks Pushpa. I am able to do what I asked in above described query.I have one more query. I am sending multiple notifications using NotiByAppControl Api. However, whenever a new new notification comes in it replaces the previously received notification inside Notification tray. What do I need to do to keep all Notifications in tray.
Pushpa G
Hi Amol, If you want to create multiple notifications, then you need to create multiple instance of NotificationManager class. AFAIK, the new Notify will replace the existing notifcation if Notify() is called for same instance. Thanks and Regards,
amol sarmalkar

Thanks Pushpa, It worked.

I have one more query. I have implemented  IAppControlResponseListener inside Service .I  implemented the function OnAppControlCompleteResponseReceived inside Service App class.

Consider following scenario:

1>My service sends a notification to main UI application.User taps that Notification.As aresult of that my main Ui application gets lauched.

2>Since I have implemented IAppControlProviderEventListener in my main UI application , the callback function OnAppControlRequestReceived gets called.

3>Now inside OnAppControlRequestReceived  , I am calling AppControlProviderManager:: SendAppControlResult function.

                       AppControlProviderManager * AppControlManager = Tizen::App::AppControlProviderManager::GetInstance();
                       if(AppControlManager)
                       {
                                    AppControlManager->SendAppControlResult(reqId,APP_CTRL_RESULT_SUCCEEDED ,pExtraData);
                       }

But the call back function inside my service OnAppControlCompleteResponseReceived  is not getting called.

Q.What paramaters I need to pass to SendAppControlResult.What should be rquestId

Q.I am not able to set  IAppControlResponseListener . I could set IAppControlProviderEventListener using AppControlProviderManager :: SetAppControlProviderEventListener.Is there any such method given to set IAppControlResponseListener .

 

Main Objective -: I want OnAppControlCompleteResponseReceived  function to get called because inside this function I want to release control over common database file shared between main Ui app and service app.

 

 

 

 

 

amol sarmalkar

I want to ask one more query i.e., auto start service on device boot.

 

Is it possible to auto- start my service on device restart.If yes then how?