GoogleIidClient - the Ruby gem for the Google Instance ID API
The Instance ID API lets you integrate Instance ID with your Android or iOS app. Instance ID provides a unique identifier for each instance of your app and a mechanism to authenticate and authorize actions, like sending messages via Firebase Cloud Messaging. https://developers.google.com/instance-id/reference/server
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
To build the Ruby code into a gem:
gem build google_iid_client.gemspec
Then either install the gem locally:
gem install ./google_iid_client-1.0.0.gem
(for development, run gem install --dev ./google_iid_client-1.0.0.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'google_iid_client', '~> 1.0.0'
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'google_iid_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'google_iid_client'
# Setup authorization
GoogleIidClient.configure do |config|
# Configure API key authorization: ServerKey
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = GoogleIidClient::InfoApi.new
iid_token = 'nKctODamlM4:CKrh_PC8kIb7O...clJONHoA' # String | A valid instance ID token.
details = true # BOOLEAN | set this query parameter to true to get available IID token details, including connection information and FCM or GCM topic subscription information (if any) for the device associated with this token. When not specified, defaults to false.
begin
#Get information about app instances
result = api_instance.iid_info_iid_token_get(iid_token, details)
p result
rescue GoogleIidClient::ApiError => e
puts "Exception when calling InfoApi->iid_info_iid_token_get: #{e}"
end
All URIs are relative to https://iid.googleapis.com
Class | Method | HTTP request | Description |
---|---|---|---|
GoogleIidClient::InfoApi | iid_info_iid_token_get | GET /iid/info/{iid_token} | Get information about app instances |
GoogleIidClient::RelationshipMapsApi | iid_v1_iid_token_rel_topics_topic_name_delete | DELETE /iid/v1/{iid_token}/rel/topics/{topic_name} | Delete a relation mapping for an app instance |
GoogleIidClient::RelationshipMapsApi | iid_v1_iid_token_rel_topics_topic_name_post | POST /iid/v1/{iid_token}/rel/topics/{topic_name} | Create a relation mapping for an app instance |
GoogleIidClient::RelationshipMapsApi | iid_v1batch_add_post | POST /iid/v1:batchAdd | Bulk add app instances to an FCM topic |
GoogleIidClient::RelationshipMapsApi | iid_v1batch_remove_post | POST /iid/v1:batchRemove | Bulk remove app instances from an FCM topic |
- GoogleIidClient::AppInstanceInfo
- GoogleIidClient::AppInstanceInfoRel
- GoogleIidClient::InlineObject
- GoogleIidClient::InlineObject1
- GoogleIidClient::InlineResponse200
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header