1
Good morning!
I have an app that will receive Pushnotification.
But the user will be able to select whether or not to receive notifications.
I have a WakefulBroadcastReceiver
and a IntentService
that check for a message.
These, start automatically, with the application.
I would like to know there is possibility to start this service only when the user selects the option. and not when to launch the application?
Statement in Androidmanifest.xml
<receiver
android:name=".services.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="br.com.app.auto.application.AutoApplication" />
</intent-filter>
</receiver>
<service android:name=".services.NotificationService" />
Thanks for your cooperation!
Greetings!
OK! I thought about stopping the service, because if the user does not want to receive the notifications, there is no need to run the Service. The server control will also be done, to avoid unnecessary processing! Thank you very much for the help!
– Thiago Luiz Domacoski