public static synchronized void subscribe ( android . content . Context context , java . lang . String channel , java . lang . Class < ? extends android . app . Activity > cls ) { startServiceIfRequired ( context , cls ) ; final String finalChannel = channel ; AVInstallation . getCurrentInstallation ( ) . addUnique ( "channels" , finalChannel ) ; _installationSaveHandler . sendMessage ( Message . obtain ( ) ) ; if ( cls != null ) { AVNotificationManager manager = AVPushMessageListener . getInstance ( ) . getNotificationManager ( ) ; manager . addDefaultPushCallback ( channel , cls . getName ( ) ) ; // set default push callback if it's not exist yet if ( manager . getDefaultPushCallback ( AVOSCloud . getApplicationId ( ) ) == null ) { manager . addDefaultPushCallback ( AVOSCloud . getApplicationId ( ) , cls . getName ( ) ) ; } } }
Helper function to subscribe to push notifications with the default application icon .