fastlane/lib/fastlane/actions/onesignal.rb in fastlane-2.169.0 vs fastlane/lib/fastlane/actions/onesignal.rb in fastlane-2.170.0
- old
+ new
@@ -15,10 +15,11 @@
auth_token = params[:auth_token]
app_name = params[:app_name].to_s
apns_p12_password = params[:apns_p12_password]
android_token = params[:android_token]
android_gcm_sender_id = params[:android_gcm_sender_id]
+ organization_id = params[:organization_id]
has_app_id = !app_id.empty?
has_app_name = !app_name.empty?
is_update = has_app_id
@@ -41,10 +42,11 @@
payload["apns_p12_password"] = apns_p12_password || ""
end
payload["gcm_key"] = android_token unless android_token.nil?
payload["android_gcm_sender_id"] = android_gcm_sender_id unless android_gcm_sender_id.nil?
+ payload["organization_id"] = organization_id unless organization_id.nil?
# here's the actual lifting - POST or PUT to OneSignal
json_headers = { 'Content-Type' => 'application/json', 'Authorization' => "Basic #{auth_token}" }
url = +'https://onesignal.com/api/v1/apps'
@@ -133,11 +135,17 @@
FastlaneCore::ConfigItem.new(key: :apns_env,
env_name: "APNS_ENV",
description: "APNS environment",
optional: true,
- default_value: 'production')
+ default_value: 'production'),
+
+ FastlaneCore::ConfigItem.new(key: :organization_id,
+ env_name: "ONE_SIGNAL_ORGANIZATION_ID",
+ sensitive: true,
+ description: "OneSignal Organization ID",
+ optional: true)
]
end
def self.output
[
@@ -161,20 +169,22 @@
app_name: "Name for OneSignal App",
android_token: "Your Android GCM key (optional)",
android_gcm_sender_id: "Your Android GCM Sender ID (optional)",
apns_p12: "Path to Apple .p12 file (optional)",
apns_p12_password: "Password for .p12 file (optional)",
- apns_env: "production/sandbox (defaults to production)"
+ apns_env: "production/sandbox (defaults to production)",
+ organization_id: "Onesignal organization id (optional)"
)',
'onesignal(
app_id: "Your OneSignal App ID",
auth_token: "Your OneSignal Auth Token",
app_name: "New Name for OneSignal App",
android_token: "Your Android GCM key (optional)",
android_gcm_sender_id: "Your Android GCM Sender ID (optional)",
apns_p12: "Path to Apple .p12 file (optional)",
apns_p12_password: "Password for .p12 file (optional)",
- apns_env: "production/sandbox (defaults to production)"
+ apns_env: "production/sandbox (defaults to production)",
+ organization_id: "Onesignal organization id (optional)"
)'
]
end
def self.category