Auxiliary Methods

Introduction

Auxiliary methods allow you to get the status of user permissions during a session.

Checking permissions

Check a permission status by invoking hasPermission function. This will return a boolean:

import com.pngme.sdk.library.PngmeSdk

// end of imports

PngmeSdk.hasPermission(context)

Checking if the session has started

There are a couple of exceptions where permissions were accepted, but SMS messages are not being sent yet.

Exception reasons:

  • The user granted permission via Android app settings (but never seen Permission flow in order to accept terms and conditions)
  • The SMS SDK was opened, the user accepted permissions but for whatever reason (network issue, no connection, timeout) and Pngme's API did not start a new session.

To start sending the SMS messages, open permission flow by calling start method again. Once a session starts, the SDK will start sending SMS data on the background.

To know if a session was started, expose the boolean operation: needInitOfSDK:

import com.pngme.sdk.library.PngmeSdk
// end of imports

PngmeSdk.needInitOfSDK(context)

Did this page help you?