Good morning! Home I have an application that will receive PushNotification. Home But the user can select whether or not to receive the notifications.
I have WakefulBroadcastReceiver
and IntentService
that check for a message.
These, start automatically, with the application. Home
I wonder if there is a possibility to start this service only when the user selects the option. and not when to start the application? Home
Declaration 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" />
Thank you for your cooperation!
Greetings!