Android Facebook content provider authority

后端 未结 4 500
渐次进展
渐次进展 2020-12-31 01:14

I\'m developing an app with (at least) two flavors having different package names - therefore actually two different apps as far as the android system is concerned. The app

4条回答
  •  余生分开走
    2020-12-31 01:56

    If your have one project and multiple flavors(means: multiple apps with minor tweaks) like me, you can

    1.create multiple facebook app (from https://developers.facebook.com/apps/)

    2.add codes for correspoding flavor

    3.add facebook_app_id string value in the corresponding flavor's folder.

    Example:

    app/build.gradle

    ...
    flavorDimensions "regular"
    
    productFlavors {
        flavour_name {
            dimension "regular"
            resValue "string", "authority", "com.facebook.app.FacebookContentProvider123456789"
        }
    

    app/src/main/AndroidManifest.xml

      
    
    
    

    app/src/flavour_name/res/values/string.xml

    123456789
    

提交回复
热议问题