当前位置: 首页>>代码示例>>Java>>正文


Java FacebookSdk.isInitialized方法代码示例

本文整理汇总了Java中com.facebook.FacebookSdk.isInitialized方法的典型用法代码示例。如果您正苦于以下问题:Java FacebookSdk.isInitialized方法的具体用法?Java FacebookSdk.isInitialized怎么用?Java FacebookSdk.isInitialized使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.FacebookSdk的用法示例。


在下文中一共展示了FacebookSdk.isInitialized方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (!FacebookSdk.isInitialized()) {
        FacebookSdk.sdkInitialize(getApplicationContext());
        AppEventsLogger.activateApp(getActivity().getApplication());
    }
    // Initialize Firebase Auth
    fireBaseAuth = FirebaseAuth.getInstance();
    fireBaseAuth.signOut();

    facebookCallbackManager = CallbackManager.Factory.create();
    registerFirebase();
    registerFacebookCallback();
    LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("email", "public_profile"));
}
 
开发者ID:Pavou,项目名称:Stalker,代码行数:17,代码来源:AuthenticateFragment.java

示例2: initFBSdk

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
private void initFBSdk() {
    if (!FacebookSdk.isInitialized()) {
        FacebookSdk.setApplicationId(ApiObjects.facebook.get("app_id"));
        FacebookSdk.sdkInitialize(getActivity().getApplicationContext());
    }
    callbackManager = CallbackManager.Factory.create();

    profileTracker = new ProfileTracker() {
        @Override
        protected void onCurrentProfileChanged(Profile oldProfile, Profile currentProfile) {
            if (eventHandler != null) {
                if (currentProfile != null)
                    eventHandler.onFacebookLoggedIn();
            }
        }
    };
}
 
开发者ID:Dnet3,项目名称:CustomAndroidOneSheeld,代码行数:18,代码来源:FacebookShield.java

示例3: sdkInitialized

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
public static void sdkInitialized() {
    if (!FacebookSdk.isInitialized()) {
        throw new FacebookSdkNotInitializedException(
                "The SDK has not been initialized, make sure to call " +
                "FacebookSdk.sdkInitialize() first.");
    }
}
 
开发者ID:eviltnan,项目名称:kognitivo,代码行数:8,代码来源:Validate.java

示例4: facebookGraphRequest

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
public void facebookGraphRequest() {
    if (!FacebookSdk.isInitialized()) {
        FacebookSdk.sdkInitialize(getApplicationContext());
        AppEventsLogger.activateApp(getApplication());
    }
    GraphRequest request = GraphRequest.newMeRequest(
            //loginResult.getAccessToken(),
            AccessToken.getCurrentAccessToken(),
            new GraphRequest.GraphJSONObjectCallback() {
                @Override
                public void onCompleted(JSONObject object, GraphResponse response) {
                    Log.v(TAG, response.toString());

                    // Application code
                    try {
                        if (object == null) return;
                        Person person = new Person();
                        String name = object.getString("name");
                        String gender = object.getString("gender"); // 01/31/1980 format
                        String id = object.getString("id");
                        Log.d(TAG, "Name: " + name + ". Gender: " + gender);
                        person.setName(name);
                        person.setId(id);
                        person.setLink("http://www.facebook.com/" + id);

                        dataKey = mPlaceReference.push().getKey();
                        mPlaceReference.child(dataKey).setValue(person);


                    } catch (JSONException e) {
                        e.printStackTrace();

                    }
                }
            });
    Bundle parameters = new Bundle();
    parameters.putString("fields", "id,name,email,gender,birthday");
    request.setParameters(parameters);
    request.executeAsync();
}
 
开发者ID:Pavou,项目名称:Stalker,代码行数:41,代码来源:PeopleListActivity.java

示例5: FacebookSignInProvider

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
/**
 * Constuctor. Intitializes the SDK and debug logs the app KeyHash that must be set up with
 * the facebook backend to allow login from the app.
 *
 * @param context the context.
 */
public FacebookSignInProvider(final Context context) {

    if (!FacebookSdk.isInitialized()) {
        Log.d(LOG_TAG, "Initializing Facebook SDK...");
        FacebookSdk.sdkInitialize(context);
        Utils.logKeyHash(context);
    }
}
 
开发者ID:jtran064,项目名称:PlatePicks-Android,代码行数:15,代码来源:FacebookSignInProvider.java

示例6: onCreate

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
  sharedPreferences =
      ((AptoideApplication) getApplicationContext()).getDefaultSharedPreferences();
  if (!FacebookSdk.isInitialized()) {
    FacebookSdk.sdkInitialize(getApplicationContext());
  }
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:10,代码来源:PermissionServiceActivity.java

示例7: login

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
public void login(Activity activity, int requestCode, Collection<String> permissions, final Callback callback) {
    if (FacebookSdk.isInitialized()) {
        Log.w("FacebookAuthProvider", "FacebookSDK was already initialized and we couldn't set the custom Request Code for the Login result. This may affect Android.Lock Library inner workings.");
        Log.w("FacebookAuthProvider", "Either initialize the SDK with the Request Code as the callbackRequestCodeOffset, or let this provider initialize the SDK.");
    } else {
        FacebookSdk.sdkInitialize(activity, requestCode);
    }
    //Use callbackRequestCodeOffset as the requestCode because Login RC is internally defined as "offset + 0".
    //see https://github.com/facebook/facebook-android-sdk/blob/master/facebook/src/main/java/com/facebook/internal/CallbackManagerImpl.java#L92
    LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
        @Override
        public void onSuccess(LoginResult result) {
            callback.onSuccess(result);
        }

        @Override
        public void onCancel() {
            callback.onCancel();
        }

        @Override
        public void onError(FacebookException error) {
            callback.onError(error);
        }
    });
    LoginManager.getInstance().logInWithReadPermissions(activity, permissions);
}
 
开发者ID:auth0,项目名称:Lock-Facebook.Android,代码行数:28,代码来源:FacebookApi.java

示例8: logout

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
public void logout() {
    if (FacebookSdk.isInitialized()){
        LoginManager.getInstance().logOut();
    } else {
        Log.w("FacebookAuthProvider", "Couldn't log out as the SDK wasn't initialized yet.");
    }
}
 
开发者ID:auth0,项目名称:Lock-Facebook.Android,代码行数:8,代码来源:FacebookApi.java

示例9: checkInit

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
public static void checkInit() {
    if (!FacebookSdk.isInitialized()) {
        throw new RuntimeException("ReactiveFB not initialized. Are you missing " +
                "ReactiveFB.sdkInitialize(context) ?");
    }
}
 
开发者ID:WassimBenltaief,项目名称:ReactiveFB,代码行数:7,代码来源:ReactiveFB.java

示例10: sdkInitialized

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
public static void sdkInitialized() {
    if (!FacebookSdk.isInitialized()) {
        throw new FacebookSdkNotInitializedException();
    }
}
 
开发者ID:CE-KMITL-OOAD-2015,项目名称:Move-Alarm_ORCA,代码行数:6,代码来源:Validate.java

示例11: isInitialized

import com.facebook.FacebookSdk; //导入方法依赖的package包/类
@Override
public boolean isInitialized() {
    return FacebookSdk.isInitialized();
}
 
开发者ID:bbqapp,项目名称:bbqapp-android,代码行数:5,代码来源:Facebook.java


注:本文中的com.facebook.FacebookSdk.isInitialized方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。