Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/2.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
catt-stefano committed Sep 22, 2017
2 parents e6aa3ca + 1e24cb4 commit 9bfd6e0
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 63 deletions.
21 changes: 1 addition & 20 deletions docs/location-based-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,7 @@ If you are also manually including ACCESS_COARSE_LOCATION in your manifest pleas
android:maxSdkVersion="22"/>
```


## Enable Background Notification

To enable our built-in background system notifications for both location and push triggers, add this in your app manifest application element.
```xml
<!-- built in background receiver -->
<receiver
android:name="it.near.sdk.recipes.background.NearItBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="it.near.sdk.permission.GEO_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="it.near.sdk.permission.PUSH_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
```
On the notification tap, your launcher activity will start.
The SDK creates a system notification for every background recipe. On the notification tap, your launcher activity will start.
To learn how to deal with in-app content once the user taps on the notification, see this [section](in-app-content.md).

If you want to customize your notifications, see this [section](custom-bkg-notification.md).
Expand Down
19 changes: 1 addition & 18 deletions docs/push-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,7 @@ ___


<br>
## Enable Background Notification

To enable our built-in background system notifications for both location and push triggers, add this in your app manifest application element.
```xml
<!-- built in background receiver -->
<receiver
android:name="it.near.sdk.recipes.background.NearItBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="it.near.sdk.permission.GEO_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="it.near.sdk.permission.PUSH_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
```
The SDK creates a system notification for every push recipe it receives.
On the notification tap, your launcher activity will start.
To learn how to deal with in-app content once the user taps on the notification, see this [section](in-app-content.md).

Expand Down
45 changes: 33 additions & 12 deletions nearit/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
android:maxSdkVersion="22"/>
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"
android:maxSdkVersion="22" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.VIBRATE" />

<application>

<!-- Services for fcm push notifications -->
<service
android:name="it.near.sdk.push.MyFcmListenerService"
android:exported="false">
Expand All @@ -21,24 +23,50 @@
</intent-filter>
</service>

<service
android:name=".push.fcmregistration.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>

<!-- Receiver and service for built-in background notification -->

<service
android:name=".recipes.background.NearItIntentService"
android:exported="false" />

<receiver
android:name="it.near.sdk.recipes.background.NearItBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="it.near.sdk.permission.GEO_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="it.near.sdk.permission.PUSH_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>


<!-- Geofence services -->
<service
android:name=".geopolis.geofences.GeoFenceService"
android:exported="false" />
<service
android:name=".geopolis.geofences.NearGeofenceTransitionsIntentService"
android:exported="false" />

<!-- Android system receivers -->
<receiver android:name=".geopolis.geofences.GeoFenceSystemEventsReceiver">
<intent-filter>
<action android:name="android.location.PROVIDERS_CHANGED" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>

<receiver
android:name=".trackings.BluetoothStatusReceiver"
android:enabled="true">
Expand All @@ -52,17 +80,10 @@
android:name=".recipes.background.AutoTrackingReceiver"
android:enabled="true" />

<service
android:name=".push.fcmregistration.MyInstanceIDListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>

<!-- Auto-init provider -->
<provider
android:authorities="${applicationId}.nearInitContentProvider"
android:name=".NearItProvider"
android:authorities="${applicationId}.nearInitContentProvider"
android:exported="false" />

</application>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public Date getRedeemableFromDate() {
return toDate(redeemable_from);
}

@Nullable
public String getIcon_id() {
return icon_id;
}
Expand Down Expand Up @@ -114,6 +115,7 @@ public String getRecipeId() {
return claims.get(0).recipe_id;
}

@Nullable
public ImageSet getIconSet() {
return iconSet;
}
Expand Down
13 changes: 0 additions & 13 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@
</intent-filter>
</activity>

<receiver
android:name="it.near.sdk.recipes.background.NearItBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="it.near.sdk.permission.GEO_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<intent-filter>
<action android:name="it.near.sdk.permission.PUSH_MESSAGE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>

<activity android:name=".ForegroundActivity" />

<activity
Expand Down

0 comments on commit 9bfd6e0

Please sign in to comment.