@@ -254,39 +254,47 @@ private synchronized void registerDeviceGCMSync( Context context, String GCMSend
254254 }
255255
256256 /**
257- * For FireBase messaging only.
257+ * For Firebase Cloud Messaging only
258258 */
259259 public void registerDevice ()
260260 {
261261 registerDevice ( Collections .singletonList ( DEFAULT_CHANNEL_NAME ) );
262262 }
263263
264264 /**
265- * For FireBase messaging only.
265+ * For Firebase Cloud Messaging only
266266 */
267267 public void registerDevice ( List <String > channels )
268268 {
269269 registerDevice ( channels , (Date ) null );
270270 }
271271
272272 /**
273- * For FireBase messaging only.
273+ * For Firebase Cloud Messaging only
274274 */
275275 public void registerDevice ( List <String > channels , Date expiration )
276276 {
277277 registerDevice ( channels , expiration , (AsyncCallback <DeviceRegistrationResult >) null );
278278 }
279279
280280 /**
281- * For FireBase messaging only.
281+ * For Firebase Cloud Messaging only
282+ */
283+ public void registerDevice ( AsyncCallback <DeviceRegistrationResult > callback )
284+ {
285+ registerDevice ( Collections .singletonList ( DEFAULT_CHANNEL_NAME ), (Date ) null , callback );
286+ }
287+
288+ /**
289+ * For Firebase Cloud Messaging only
282290 */
283291 public void registerDevice ( List <String > channels , AsyncCallback <DeviceRegistrationResult > callback )
284292 {
285293 registerDevice ( channels , (Date ) null , callback );
286294 }
287295
288296 /**
289- * For FireBase messaging only.
297+ * For Firebase Cloud Messaging only
290298 */
291299 public void registerDevice ( List <String > channels , Date expiration , AsyncCallback <DeviceRegistrationResult > callback )
292300 {
@@ -295,21 +303,21 @@ public void registerDevice( List<String> channels, Date expiration, AsyncCallbac
295303
296304 if ( channels == null || channels .isEmpty () ||
297305 (channels .size () == 1 && (channels .get ( 0 ) == null || channels .get ( 0 ).isEmpty ())) )
298- {
299306 channels = Collections .singletonList ( DEFAULT_CHANNEL_NAME );
300- }
301307
302308 for ( String channel : channels )
303309 checkChannelName ( channel );
304310
305311 long expirationMs = 0 ;
312+
306313 if ( expiration != null )
307314 {
308315 if ( expiration .before ( Calendar .getInstance ().getTime () ) )
309316 throw new IllegalArgumentException ( ExceptionMessage .WRONG_EXPIRATION_DATE );
310317 else
311318 expirationMs = expiration .getTime ();
312319 }
320+
313321 FCMRegistration .registerDevice ( ContextHandler .getAppContext (), channels , expirationMs , callback );
314322 }
315323
0 commit comments