Use different GoogleService-Info.plist for different build schemes

后端 未结 17 762
梦毁少年i
梦毁少年i 2020-12-07 07:49

I am using a build scheme for prod and one for staging (with 2 different bundle identifiers) and I am trying to use a separate GoogleService-Info.plist for each scheme. Is t

17条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 08:36

    I noticed that google expects the filename to be GoogleServiceInfo.plist in the code:

     * The method |configureWithError:| will read from the file GoogleServices-Info.plist bundled with
     * your app target for the keys to configure each individual API. To generate your
     * GoogleServices-Info.plist, please go to https://developers.google.com/mobile/add
     *
     * @see GGLContext (Analytics)
     * @see GGLContext (SignIn)
     */
    @interface GGLContext : NSObject
    

    the key phrase is this one

    read from the file GoogleServices-Info.plist bundled with your app target

    So I simply copied the same file and put it into different directories, and bounded it to different targets:

提交回复
热议问题