Class MetaDataUtils


  • public class MetaDataUtils
    extends java.lang.Object
    Utility class to easily access the manifest meta-data info
    • Constructor Summary

      Constructors 
      Constructor Description
      MetaDataUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static android.os.Bundle getAppMetaData​(android.content.Context context)
      Get the bundle meta data info from the AndroidManifest
      static boolean getBooleanMetaData​(android.content.Context context, java.lang.String key)
      Get a boolean meta-data info value from the manifest
      static int getIntMetaData​(android.content.Context context, java.lang.String key)
      Get an integer meta-data info value from the manifest
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MANIFEST_SENDER_ID_KEY

        public static final java.lang.String MANIFEST_SENDER_ID_KEY
        See Also:
        Constant Field Values
      • MANIFEST_FORCE_FCM_IID_KEY

        public static final java.lang.String MANIFEST_FORCE_FCM_IID_KEY
        See Also:
        Constant Field Values
    • Constructor Detail

      • MetaDataUtils

        public MetaDataUtils()
    • Method Detail

      • getAppMetaData

        public static android.os.Bundle getAppMetaData​(android.content.Context context)
                                                throws android.content.pm.PackageManager.NameNotFoundException
        Get the bundle meta data info from the AndroidManifest
        Parameters:
        context - Application context
        Returns:
        the bundle meta-data
        Throws:
        android.content.pm.PackageManager.NameNotFoundException - exception
      • getBooleanMetaData

        public static boolean getBooleanMetaData​(android.content.Context context,
                                                 java.lang.String key)
        Get a boolean meta-data info value from the manifest
        Parameters:
        context - Application context
        key - key of the meta-data info
        Returns:
        the meta-data value in the manifest or false if key do not exist
      • getIntMetaData

        public static int getIntMetaData​(android.content.Context context,
                                         java.lang.String key)
        Get an integer meta-data info value from the manifest
        Parameters:
        context - Application context
        key - key of the meta-data info
        Returns:
        the meta-data value in the manifest or -1 if key do not exist