Push
Ocamba provides powerful messaging services to reach your users.
By initializing the SDK you can quickly and easily receive push notifications.
Push is disabled by default. To use Ocamba push, you have to add the following:
```java
OcambaHoood.getBuilder().push().init();
```
If you want to read fcm token use following:
```java
OcambaHoood.getInstance().getFcmToken();
```
For notifications to work in expected way you will need to enable permission. You can easily create and customize a “soft-prompt” to ask users to grant your app permission to send push notifications. If the user selects “Allow”, the system’s push permission prompt appears.
- Open manifest file and add following:
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
- Now you can choose SDK to handle permission for you:
```java
OcambaHoood.getInstance().askForPushNotifications(true, new OcambaHoood.PromptForPushNotificationPermissionCallback() {
@Override
public void notificationsPermission(boolean accepted) {
}
});
```
- Or you can handle permission and when user accepts permission call this method:
```java
OcambaHoood.getInstance().notificationsPermissionAllowed();
```
This method will record user action on Ocamba platform.
NOTE: you’ll need to set up an FCM project and configure push for your app (Add Firebase SDK section).