com.google.firebase.messaging.FirebaseMessagingService Java Examples

The following examples show how to use com.google.firebase.messaging.FirebaseMessagingService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ReactNativeFirebaseMessagingServiceTest.java    From react-native-azurenotificationhub with MIT License 5 votes vote down vote up
@Before
public void setUp() {
    // Reset mocks
    reset(mHubUtil);
    reset(mReactApplicationContext);

    // Prepare mock objects
    PowerMockito.mockStatic(ReactNativeNotificationHubUtil.class);
    when(ReactNativeNotificationHubUtil.getInstance()).thenReturn(mHubUtil);
    PowerMockito.mockStatic(ReactNativeNotificationsHandler.class);
    PowerMockito.mockStatic(ReactNativeRegistrationIntentService.class);
    PowerMockito.mockStatic(ReactNativeNotificationChannelBuilder.Factory.class);
    PowerMockito.mockStatic(ReactNativeNotificationHubUtil.IntentFactory.class);
    PowerMockito.suppress(methodsDeclaredIn(FirebaseMessagingService.class));
    PowerMockito.mockStatic(Log.class);
    when(mReactApplicationContext.getSystemService(Context.NOTIFICATION_SERVICE)).thenReturn(
            mNotificationManager);

    // Reset channel
    ReactNativeFirebaseMessagingService.deleteNotificationChannel(mReactApplicationContext);
    reset(mNotificationManager);
    when(mReactApplicationContext.getSystemService(Context.NOTIFICATION_SERVICE)).thenReturn(
            mNotificationManager);

    mMessagingService = new ReactNativeFirebaseMessagingService();

}
 
Example #2
Source File: RNReceivedMessageHandler.java    From react-native-push-notification with MIT License 4 votes vote down vote up
public RNReceivedMessageHandler(@NonNull FirebaseMessagingService service) {
    this.mFirebaseMessagingService = service;
}