當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。