diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 42fba0cc..d8a3c41a 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1868,8 +1868,8 @@ localizationTargetInfo language_packs:vector = LocalizationTar //@class DeviceToken @description Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, you must specify the correct application platform and upload valid server authentication data at https://my.telegram.org -//@description A token for Google Cloud Messaging @token Device registration token; may be empty to de-register a device @encrypt True, if push notifications should be additionally encrypted -deviceTokenGoogleCloudMessaging token:string encrypt:Bool = DeviceToken; +//@description A token for Firebase Cloud Messaging @token Device registration token; may be empty to de-register a device @encrypt True, if push notifications should be additionally encrypted +deviceTokenFirebaseCloudMessaging token:string encrypt:Bool = DeviceToken; //@description A token for Apple Push Notification service @device_token Device token; may be empty to de-register a device @is_app_sandbox True, if App Sandbox is enabled deviceTokenApplePush device_token:string is_app_sandbox:Bool = DeviceToken; diff --git a/td/generate/scheme/td_api.tlo b/td/generate/scheme/td_api.tlo index 1470469e..bc49c075 100644 Binary files a/td/generate/scheme/td_api.tlo and b/td/generate/scheme/td_api.tlo differ diff --git a/td/telegram/DeviceTokenManager.cpp b/td/telegram/DeviceTokenManager.cpp index 00b0f042..dec7ddd5 100644 --- a/td/telegram/DeviceTokenManager.cpp +++ b/td/telegram/DeviceTokenManager.cpp @@ -131,10 +131,10 @@ void DeviceTokenManager::register_device(tl_object_ptr devi is_app_sandbox = device_token->is_app_sandbox_; break; } - case td_api::deviceTokenGoogleCloudMessaging::ID: { - auto device_token = static_cast(device_token_ptr.get()); + case td_api::deviceTokenFirebaseCloudMessaging::ID: { + auto device_token = static_cast(device_token_ptr.get()); token = std::move(device_token->token_); - token_type = TokenType::GCM; + token_type = TokenType::FCM; encrypt = device_token->encrypt_; break; } diff --git a/td/telegram/DeviceTokenManager.h b/td/telegram/DeviceTokenManager.h index fd04e6f6..1cbe6083 100644 --- a/td/telegram/DeviceTokenManager.h +++ b/td/telegram/DeviceTokenManager.h @@ -37,7 +37,7 @@ class DeviceTokenManager : public NetQueryCallback { ActorShared<> parent_; enum TokenType : int32 { APNS = 1, - GCM = 2, + FCM = 2, MPNS = 3, SIMPLE_PUSH = 4, UBUNTU_PHONE = 5, diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index c50a5fa4..2b7ebddf 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1430,9 +1430,9 @@ class CliClient final : public Actor { } else if (op == "rdb") { send_request(td_api::make_object( td_api::make_object(args), as_user_ids(""))); - } else if (op == "rdg") { + } else if (op == "rdf") { send_request(td_api::make_object( - td_api::make_object(args, true), as_user_ids(""))); + td_api::make_object(args, true), as_user_ids(""))); } else if (op == "rdt") { string token; string other_user_ids_str;