Module: Exponent

Defined in:
lib/exponent-server-sdk-jm.rb,
lib/exponent-server-sdk-jm/version.rb

Overview

Basic Usage:

Create new client client = Exponent::Push::Client.new(**args)

Send UPTO ~~100~~ messages per call, docs.expo.io/versions/latest/guides/push-notifications/#message-format response_handler = client.send_messages([list of formatted messages])

Check the response to see if any errors were re response_handler.errors?

To process each error, iterate over the errors array which contains each Error class instance response_handler.errors

There is an array of invalid ExponentPushTokens that were found in the initial /send call response_handler.invalid_push_tokens[‘ExponentPushToken’]

You can use the handler to get receipt_ids response_handler.receipt_ids

You can pass an array of receipt_ids to verify_deliveries method and it will populate a new ResponseHandler with any errors receipt_response = client.verify_deliveries(receipt_ids)

Defined Under Namespace

Modules: Push

Constant Summary collapse

VERSION =
'0.1.1'.freeze

Class Method Summary collapse

Class Method Details

.is_exponent_push_token?(token) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/exponent-server-sdk-jm.rb', line 33

def self.is_exponent_push_token?(token)
  token.start_with?('ExponentPushToken')
end