Skip to content

Android Manifest components

Ivan Krešić edited this page Oct 10, 2024 · 25 revisions

All required components are included into library manifest and manifest merger shall put all the components to the hosting application automatically. Manifest merger is enabled by default for android projects, but it can be disabled manually. Below is the list of manifest components needed for Mobile Messaging library. These components shall be put into application manifest if manifest merger was disabled.

Push notifications

<manifest>

    <!-- Existing manifest entries -->
 
    <!-- Mobile Messaging permissions -->
    
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
    <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" />
 
    <!-- Needed for push notifications that contain VIBRATE flag. Optional, but recommended. -->
    <uses-permission android:name="android.permission.VIBRATE" />
    
    <!-- /Mobile Messaging permissions -->
    
  
    <application>
    
        <!-- Existing application entries -->
 
        <!-- Mobile Messaging components -->
        
        <service
            android:name="org.infobip.mobile.messaging.cloud.firebase.MobileMessagingFirebaseService"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT"/>
            </intent-filter>
        </service>

        <service
            android:name="org.infobip.mobile.messaging.cloud.MobileMessagingCloudService"
            android:permission="android.permission.BIND_JOB_SERVICE"
            android:exported="false" >
        </service>

        <service
            android:name="org.infobip.mobile.messaging.platform.MobileMessagingJobService"
            android:enabled="false"
            android:exported="false"
            android:permission="android.permission.BIND_JOB_SERVICE" />

       <activity
            android:name="org.infobip.mobile.messaging.NotificationTapReceiverActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:noHistory="true"
            android:taskAffinity=""
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <receiver
            android:name="org.infobip.mobile.messaging.MobileMessagingConnectivityReceiver"
            android:enabled="false"
            android:exported="false">
            <intent-filter>
                <!-- Intent filter is for pre-7.0 Nougat devices -->
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            </intent-filter>
        </receiver>
        
       <receiver
            android:name="org.infobip.mobile.messaging.interactive.notification.NotificationActionTapReceiver"
            android:exported="false" />

        <!-- /Mobile Messaging components -->
     
    </application>
</manifest>

Geo (Deprecated)

<manifest>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

    <application>
        <!-- Your existing entries -->
		
        <!-- Geo components -->
	
        <!--Service that's triggered by GeofenceTransitionsReceiver when geofence area is entered-->
        <service
            android:name="org.infobip.mobile.messaging.geo.transition.GeofenceTransitionsIntentService"
            android:permission="android.permission.BIND_JOB_SERVICE"
            android:enabled="false" />

        <!--Receiver that triggers when geofence area is entered-->
        <receiver
            android:name="org.infobip.mobile.messaging.geo.transition.GeofenceTransitionsReceiver"
            android:enabled="false">
        </receiver>

        <!-- Receiver that handles BOOT_COMPLETED broadcast to revise delayed geofencing campaigns -->
        <receiver
	    android:name="org.infobip.mobile.messaging.geo.BootReceiver"
	    android:enabled="false">
	    <intent-filter>
	        <action android:name="android.intent.action.BOOT_COMPLETED"/>
	    </intent-filter>
	</receiver>
  
	 <!--Service that's triggered by GeofencingConsistencyReceiver when consistency of geo monitoring needs to be maintained-->
        <service
            android:name="org.infobip.mobile.messaging.geo.GeofencingConsistencyIntentService"
            android:permission="android.permission.BIND_JOB_SERVICE"
            android:enabled="false" />
        <receiver
            android:name="org.infobip.mobile.messaging.geo.GeofencingConsistencyReceiver"
            android:enabled="false">
            <intent-filter>
                <action android:name="android.intent.action.TIME_SET" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.PACKAGE_DATA_CLEARED" />
                <data android:scheme="package" />
            </intent-filter>
        </receiver>

        <!--Receiver used for versions below Android O to provide consistency-->
        <receiver
            android:name="org.infobip.mobile.messaging.geo.GeoEnabledConsistencyReceiver"
            android:enabled="false">
            <intent-filter>
                <action android:name="android.location.PROVIDERS_CHANGED" />
            </intent-filter>
        </receiver>

	<!-- /Geo components -->

    </application>
</manifest>

NOTE: RECEIVE_BOOT_COMPLETED permission is required in order to properly handle delayed monitoring of geofencing campaigns on a device.

In-app chat

<manifest xmlns:android="http://schemas.android.com/apk/res/android">

    <queries>
        <intent>
            <action android:name="android.media.action.IMAGE_CAPTURE" />
        </intent>
    </queries>

    <!-- In-app chat permissions -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
                     android:maxSdkVersion="28" />
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
    <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />

    <application
        android:allowBackup="false"
        android:usesCleartextTraffic="false"
        android:enableOnBackInvokedCallback="true">
        
        <activity
            android:name=".view.InAppChatAttachmentPreviewActivity"
            android:screenOrientation="portrait"
            android:theme="@style/IB_ChatDefaultTheme" />
        
        <activity
            android:name=".view.InAppChatActivity"
            android:noHistory="false"
            android:screenOrientation="portrait"
            android:theme="@style/IB_ChatDefaultTheme" />

        <receiver
            android:name=".core.PersonalizationBroadcastReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="org.infobip.mobile.messaging.PERSONALIZED" />
            </intent-filter>
        </receiver>

        <meta-data
            android:name="org.infobip.mobile.messaging.chat.InAppChatImpl"
            android:value="org.infobip.mobile.messaging.MessageHandlerModule" />

    </application>
</manifest>

InfobipRtcUi

<manifest>

    <!-- InfobipRtcUi permissions -->
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_PHONE_CALL" />
    <uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION" />

    <application>
        <!-- Calls UI -->
        <activity
            android:name=".CallActivity"
            android:autoRemoveFromRecents="true"
            android:exported="false"
            android:launchMode="singleTask"
            android:noHistory="true"
            android:showWhenLocked="true"
            android:supportsPictureInPicture="true"
            android:configChanges="screenSize|smallestScreenSize|screenLayout|orientation"
            android:taskAffinity=""
            android:theme="@style/InfobipRtcUi.Call"
            android:turnScreenOn="true" />
        <!-- Receiver to obtain mandatory data to be able to receive calls based on IB unique identity -->
        <receiver
            android:name=".receiver.PushIdBroadcastReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="org.infobip.mobile.messaging.REGISTRATION_CREATED" />
            </intent-filter>
        </receiver>
        <!-- Receiver to obtain mandatory data to receive In-app chat calls -->
        <receiver
            android:name=".receiver.LcRegIdBroadcastReceiver"
            android:exported="false">
            <intent-filter>
                <action android:name="org.infobip.mobile.messaging.chat.LIVECHAT_REGISTRATION_ID_UPDATED" />
            </intent-filter>
        </receiver>
        <!-- Service to handle incoming calls -->
        <service
            android:name=".service.DefaultIncomingCallService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>
        <!-- Service to handle call -->
        <service
            android:name=".service.OngoingCallService"
            android:exported="false"
            android:foregroundServiceType="phoneCall" />
        <!-- Service to support screen share in call -->
        <service
            android:name=".service.ScreenShareService"
            android:exported="false"
            android:foregroundServiceType="mediaProjection" />
        <service android:name="com.infobip.webrtc.sdk.impl.fcm.FcmTokenRefresher" />
        <!-- Service to handle FCM token refresh -->
        <service
            android:name="com.infobip.webrtc.sdk.impl.push.FcmTokenRefresher"
            android:exported="false" />
    </application>

</manifest>
Clone this wiki locally