Given the following benefits for the application:
productFlavors { pro { applicationId = "com.example.my.pkg.pro" } free { applicationId = "com.example.my.pkg.free" } }
And I need to declare GCM permissions:
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <permission android:name="com.example.gcm.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="com.example.gcm.permission.C2D_MESSAGE" /> <application ...> <receiver android:name=".GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.example.gcm" /> </intent-filter> </receiver> <service android:name=".GcmIntentService" /> </application>
If com.example.gcmยด needs to be replaced with com.example.my.pkg.pro or com.example.my.pkg.free depending on the current taste.
How to configure my manifest to automatically select the package defined in the applicationId field?
Addev source share