| Index: ios/chrome/browser/application_context_impl.cc
|
| diff --git a/ios/chrome/browser/application_context_impl.cc b/ios/chrome/browser/application_context_impl.cc
|
| index 4f7ace27c42356a3cf80bf31b99e06da561a19dd..567118744663ea4b607061db25517decb5b97e3c 100644
|
| --- a/ios/chrome/browser/application_context_impl.cc
|
| +++ b/ios/chrome/browser/application_context_impl.cc
|
| @@ -338,6 +338,19 @@ void ApplicationContextImpl::CreateGCMDriver() {
|
|
|
| base::FilePath store_path;
|
| CHECK(PathService::Get(ios::DIR_GLOBAL_GCM_STORE, &store_path));
|
| +
|
| +// These strings must never change during the lifetime of a Chrome install,
|
| +// since e.g. to unregister an Instance ID token the same category must be
|
| +// passed to FCM as was originally passed when registering it.
|
| +#if defined(GOOGLE_CHROME_BUILD)
|
| + std::string channel = ::GetChannelString();
|
| + if (channel.empty())
|
| + channel = "stable";
|
| + std::string product_category_for_subtypes = "com.chrome." + channel + ".ios";
|
| +#else
|
| + std::string product_category_for_subtypes = "org.chromium.unknown.ios";
|
| +#endif
|
| +
|
| base::SequencedWorkerPool* worker_pool = web::WebThread::GetBlockingPool();
|
| scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
|
| worker_pool->GetSequencedTaskRunnerWithShutdownBehavior(
|
| @@ -347,6 +360,7 @@ void ApplicationContextImpl::CreateGCMDriver() {
|
| gcm_driver_ = gcm::CreateGCMDriverDesktop(
|
| base::WrapUnique(new gcm::GCMClientFactory), GetLocalState(), store_path,
|
| GetSystemURLRequestContext(), ::GetChannel(),
|
| + product_category_for_subtypes,
|
| web::WebThread::GetTaskRunnerForThread(web::WebThread::UI),
|
| web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
|
| blocking_task_runner);
|
|
|