Failed to find provider info for com.facebook.katana.provider.AttributionIdProvider

前端 未结 8 1303
别那么骄傲
别那么骄傲 2020-12-24 05:11

Anyone knows what does this error mean? I get it in LogCat shell every time I connect with my android application to Facebook (via emulator).

The code which in charg

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 05:25

    As @Vinay-S-Shenoy said, that happens when the Facebook app its not installed on the phone or the simulator. What I do, to avoid this error is to check if the Facebook app its installed before call the facebook.authorize method, an in case the facebook app its not installed I alert this message to the user.

    public boolean isFacebookAvailable() {
    
        Intent intent = new Intent(Intent.ACTION_SEND);
    intent.putExtra(Intent.EXTRA_TEXT, "Test; please ignore");
    intent.setType("text/plain");
    
        final PackageManager pm = this.getApplicationContext().getPackageManager();
        for(ResolveInfo resolveInfo: pm.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)){
            ActivityInfo activity = resolveInfo.activityInfo;
            // Log.i("actividad ->", activity.name);
            if (activity.name.contains("com.facebook.katana")) {
                return true;
            }
        }
        return false;
    }
    

提交回复
热议问题