【问题标题】:Deleting Repeated Services from Android GCM Config File从 Android GCM 配置文件中删除重复服务
【发布时间】:2015-06-10 10:06:46
【问题描述】:

在为我的 Android 应用程序实现 GCM 时,我不得不多次创建配置文件 (see here)。因为我这样做了,您选择添加的服务被多次“添加”,所以我的配置文件现在比必要的长得多,因为服务重复了多次。有谁知道如何从我的应用程序中“删除”服务?我现在只想启用 GCM。显然我可以从 json 中删除它,但这对后端没有任何作用。我确定它在 Google Dev Console 中,但似乎找不到。谢谢!

或者,这是否是 GCM 配置文件的正确布局?我不这么认为,因为我做了演示应用程序,它有一个长度约为 500 个字符的配置文件,而我的开始长度大约是这个长度,每次我创建一个新长度时,它都会变得越来越长,现在有 1712 个字符。

配置文件

{  
   "project_info":{  
      "project_id":"project-id",
      "project_number":"96363846xxxx",
      "name":"ProjectName"
   },
   "client":[  
      {  
         "client_info":{  
            "client_id":"android:xxx.xxx",
            "client_type":1,
            "android_client_info":{  
               "package_name":"package.name"
            }
         },
         "oauth_client":[  

         ],
         "services":{  
            "analytics_service":{  
               "status":1
            },
            "cloud_messaging_service":{  
               "status":1,
               "apns_config":[  

               ]
            },
            "appinvite_service":{  
               "status":1,
               "other_platform_oauth_client":[  

               ]
            },
            "google_signin_service":{  
               "status":1
            },
            "ads_service":{  
               "status":1
            }
         }
      },
      {  
         "client_info":{  
            "client_id":"android:xxx.xxx",
            "client_type":1,
            "android_client_info":{  
               "package_name":"package.name"
            }
         },
         "oauth_client":[  

         ],
         "services":{  
            "analytics_service":{  
               "status":1
            },
            "cloud_messaging_service":{  
               "status":2,
               "apns_config":[  

               ]
            },
            "appinvite_service":{  
               "status":1,
               "other_platform_oauth_client":[  

               ]
            },
            "google_signin_service":{  
               "status":1
            },
            "ads_service":{  
               "status":1
            }
         }
      },
      {  
         "client_info":{  
            "client_id":"android:xxx.xxx",
            "client_type":1,
            "android_client_info":{  
               "package_name":"package.name"
            }
         },
         "oauth_client":[  

         ],
         "services":{  
            "analytics_service":{  
               "status":1
            },
            "cloud_messaging_service":{  
               "status":2,
               "apns_config":[  

               ]
            },
            "appinvite_service":{  
               "status":1,
               "other_platform_oauth_client":[  

               ]
            },
            "google_signin_service":{  
               "status":1
            },
            "ads_service":{  
               "status":1
            }
         }
      },
      {  
         "client_info":{  
            "client_id":"android:xxx.xxx",
            "client_type":1,
            "android_client_info":{  
               "package_name":"package.name"
            }
         },
         "oauth_client":[  

         ],
         "services":{  
            "analytics_service":{  
               "status":1
            },
            "cloud_messaging_service":{  
               "status":2,
               "apns_config":[  

               ]
            },
            "appinvite_service":{  
               "status":1,
               "other_platform_oauth_client":[  

               ]
            },
            "google_signin_service":{  
               "status":1
            },
            "ads_service":{  
               "status":1
            }
         }
      }
   ]
}

【问题讨论】:

    标签: android file configuration google-cloud-messaging


    【解决方案1】:

    转到Developers Console
    转到相应的项目。
    点击 APIs & Auth >> APIs >> 您将在顶部看到 “启用的 APIs” 选项卡 >> 禁用 >。

    这将停止对您此时不想调用的 API 的调用。当您需要它们时,您可以从控制台再次启用它们。

    希望这会有所帮助!

    【讨论】:

    • 这不是我要找的 - 不过感谢您的尝试。
    猜你喜欢
    • 1970-01-01
    • 2016-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-03
    相关资源
    最近更新 更多