File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,27 +48,24 @@ Or install it yourself as:
4848Please follow the [ installation] ( #installation ) procedure and then run the following code:
4949
5050``` ruby
51- # Load the gem
51+ require ' time '
5252require ' onesignal'
53-
54- # Setup authorization
53+ # setup authorization
5554OneSignal .configure do |config |
5655 # Configure Bearer authorization: app_key
57- config.access_token = ' YOUR BEARER TOKEN'
56+ config.access_token = ' YOUR BEARER TOKEN' # Change this
5857end
5958
6059api_instance = OneSignal ::DefaultApi .new
61- app_id = ' APP ID EXAMPLE' # String |
62- notification_id = ' NOTIFICATION ID EXAMPLE' # String |
60+ notification = OneSignal ::Notification .new ({app_id: ' YOUR APP ID' }) # Notification
6361
6462begin
65- # Stop a scheduled or currently outgoing notification
66- result = api_instance.cancel_notification(app_id, notification_id )
63+ # Create notification
64+ result = api_instance.create_notification(notification )
6765 p result
6866rescue OneSignal ::ApiError => e
69- puts " Exception when calling DefaultApi->cancel_notification : #{ e } "
67+ puts " Error when calling DefaultApi->create_notification : #{ e } "
7068end
71-
7269```
7370
7471## Documentation for API Endpoints
You can’t perform that action at this time.
0 commit comments