Search in sources :

Example 6 with GeofencingHelper

use of org.infobip.mobile.messaging.geo.geofencing.GeofencingHelper in project mobile-messaging-sdk-android by infobip.

the class BootReceiver method onReceive.

@Override
public void onReceive(Context context, Intent intent) {
    if (!Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
        return;
    }
    MobileMessagingLogger.i("Received boot completed intent");
    GeofencingHelper geofencingHelper = new GeofencingHelper(context);
    geofencingHelper.handleBootCompleted();
}
Also used : GeofencingHelper(org.infobip.mobile.messaging.geo.geofencing.GeofencingHelper)

Example 7 with GeofencingHelper

use of org.infobip.mobile.messaging.geo.geofencing.GeofencingHelper in project mobile-messaging-sdk-android by infobip.

the class MessageStoreTest method test_shouldUseGeoSqlStoreForGeo_whenConfiguredWithMessageStore.

@Test
public void test_shouldUseGeoSqlStoreForGeo_whenConfiguredWithMessageStore() {
    MobileMessagingCore.setMessageStoreClass(context, TestMessageStore.class);
    assertTrue(new GeofencingHelper(context).getMessageStoreForGeo() instanceof GeoSQLiteMessageStore);
}
Also used : GeofencingHelper(org.infobip.mobile.messaging.geo.geofencing.GeofencingHelper) GeoSQLiteMessageStore(org.infobip.mobile.messaging.geo.storage.GeoSQLiteMessageStore) Test(org.junit.Test)

Example 8 with GeofencingHelper

use of org.infobip.mobile.messaging.geo.geofencing.GeofencingHelper in project mobile-messaging-sdk-android by infobip.

the class GeoAreasHandlerTests method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    enableMessageStoreForReceivedMessages();
    geoNotificationHelper = Mockito.mock(GeoNotificationHelper.class);
    geoReporter = Mockito.mock(GeoReporter.class);
    messageStore = Mockito.mock(MessageStore.class);
    geoAreasHandler = new GeoAreasHandler(contextMock, mobileMessagingCore, geoNotificationHelper, geoReporter, new GeofencingHelper(context));
    geoReportCaptor = ArgumentCaptor.forClass(GeoReport[].class);
    geoNotificationCaptor = new ArgumentCaptor<>();
}
Also used : MessageStore(org.infobip.mobile.messaging.storage.MessageStore) GeofencingHelper(org.infobip.mobile.messaging.geo.geofencing.GeofencingHelper) GeoAreasHandler(org.infobip.mobile.messaging.geo.transition.GeoAreasHandler) GeoReporter(org.infobip.mobile.messaging.geo.report.GeoReporter) GeoNotificationHelper(org.infobip.mobile.messaging.geo.transition.GeoNotificationHelper)

Aggregations

GeofencingHelper (org.infobip.mobile.messaging.geo.geofencing.GeofencingHelper)8 Test (org.junit.Test)3 GeoSQLiteMessageStore (org.infobip.mobile.messaging.geo.storage.GeoSQLiteMessageStore)2 MessageStore (org.infobip.mobile.messaging.storage.MessageStore)2 SuppressLint (android.annotation.SuppressLint)1 Context (android.content.Context)1 ArrayMap (android.support.v4.util.ArrayMap)1 Date (java.util.Date)1 Message (org.infobip.mobile.messaging.Message)1 MobileApiMessages (org.infobip.mobile.messaging.api.messages.MobileApiMessages)1 MobileApiRegistration (org.infobip.mobile.messaging.api.registration.MobileApiRegistration)1 GeoEventType (org.infobip.mobile.messaging.geo.GeoEventType)1 GeoBroadcaster (org.infobip.mobile.messaging.geo.platform.GeoBroadcaster)1 GeoReporter (org.infobip.mobile.messaging.geo.report.GeoReporter)1 GeoAreasHandler (org.infobip.mobile.messaging.geo.transition.GeoAreasHandler)1 GeoNotificationHelper (org.infobip.mobile.messaging.geo.transition.GeoNotificationHelper)1 MobileApiResourceProvider (org.infobip.mobile.messaging.mobile.MobileApiResourceProvider)1 NotificationHandler (org.infobip.mobile.messaging.notification.NotificationHandler)1 Broadcaster (org.infobip.mobile.messaging.platform.Broadcaster)1 Before (org.junit.Before)1