本文整理汇总了Java中com.facebook.share.model.AppInviteContent类的典型用法代码示例。如果您正苦于以下问题:Java AppInviteContent类的具体用法?Java AppInviteContent怎么用?Java AppInviteContent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AppInviteContent类属于com.facebook.share.model包,在下文中一共展示了AppInviteContent类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createAppCall
import com.facebook.share.model.AppInviteContent; //导入依赖的package包/类
@Override
public AppCall createAppCall(final AppInviteContent content) {
final AppCall appCall = createBaseAppCall();
DialogPresenter.setupAppCallForNativeDialog(
appCall,
new DialogPresenter.ParameterProvider() {
@Override
public Bundle getParameters() {
return createParameters(content);
}
@Override
public Bundle getLegacyParameters() {
// App Invites are not supported with legacy fb4a devices.
// We should never get here
Log.e(TAG, "Attempting to present the AppInviteDialog with " +
"an outdated Facebook app on the device");
return new Bundle();
}
},
getFeature());
return appCall;
}
开发者ID:eviltnan,项目名称:kognitivo,代码行数:26,代码来源:AppInviteDialog.java
示例2: createParameters
import com.facebook.share.model.AppInviteContent; //导入依赖的package包/类
private static Bundle createParameters(final AppInviteContent content) {
Bundle params = new Bundle();
params.putString(ShareConstants.APPLINK_URL, content.getApplinkUrl());
params.putString(ShareConstants.PREVIEW_IMAGE_URL, content.getPreviewImageUrl());
return params;
}
开发者ID:eviltnan,项目名称:kognitivo,代码行数:9,代码来源:AppInviteDialog.java
示例3: appInviteFacebook
import com.facebook.share.model.AppInviteContent; //导入依赖的package包/类
private void appInviteFacebook() {
String appLinkUrl, previewImageUrl;
Context context = ActivityMain.this;
//appLinkUrl = "https://play.google.com/store/apps/details?id=" + context.getPackageName();
appLinkUrl = context.getString(R.string.facebook_app_url);
previewImageUrl = "http://protoolapps.com/static/media/uploads/protoolapps.com/playstore-icon.png";
if (AppInviteDialog.canShow()) {
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(appLinkUrl)
.setPreviewImageUrl(previewImageUrl)
.build();
AppInviteDialog.show(this, content);
}
}
开发者ID:ruibar,项目名称:android-protwall,代码行数:15,代码来源:ActivityMain.java
示例4: presentChannelInterface
import com.facebook.share.model.AppInviteContent; //导入依赖的package包/类
@Override
public void presentChannelInterface(InviteChannel inviteChannel, InvitePackage invitePackage, final InviteCallback callback) {
if (isConnected()) {
AppInviteContent.Builder contentBuilder = new AppInviteContent.Builder();
contentBuilder.setApplinkUrl(invitePackage.getReferralUrl());
if (invitePackage.getImageUrl() != null && invitePackage.getImage() != null) {
contentBuilder.setPreviewImageUrl(invitePackage.getImageUrl());
}
AppInviteContent sharedContent = contentBuilder.build();
AppInviteDialog appInviteDialog = new AppInviteDialog(_activity);
appInviteDialog.registerCallback(_callbackManager, new FacebookCallback<AppInviteDialog.Result>() {
@Override
public void onSuccess(AppInviteDialog.Result result) {
callback.onComplete();
}
@Override
public void onCancel() {
callback.onCancel();
}
@Override
public void onError(FacebookException facebookException) {
callback.onError(facebookException);
}
}
);
appInviteDialog.show(sharedContent);
} else {
onError("Can't reach Facebook. No internet connection.", callback);
}
}
开发者ID:getsocial-im,项目名称:getsocial-android-sdk,代码行数:35,代码来源:FacebookInvitePlugin.java
示例5: canShow
import com.facebook.share.model.AppInviteContent; //导入依赖的package包/类
@Override
public boolean canShow(AppInviteContent content) {
return AppInviteDialog.canShowNativeDialog();
}
开发者ID:eviltnan,项目名称:kognitivo,代码行数:5,代码来源:AppInviteDialog.java
示例6: onCreate
import com.facebook.share.model.AppInviteContent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
sharedPreferences = getSharedPreferences("MOVEALARM_PREFERENCE", Context.MODE_PRIVATE);
super.onCreate(savedInstanceState);
usermanagemnent = UserManagement.instance();
if(UserManagement.instance().wantLogout){
LoginManager.getInstance().logOut();
UserManagement.instance().userlogout();
}
FacebookSdk.sdkInitialize(getApplicationContext());
callbackManager = CallbackManager.Factory.create();
setContentView(R.layout.activity_login);
if (FriendManagement.wantmorefriend) {
FriendManagement.wantmorefriend = false;
String appLinkUrl, previewImageUrl;
appLinkUrl = "https://fb.me/888833747879377";
previewImageUrl = "blob:https%3A//drive.google.com/a0c8eb9e-ba93-4ab1-a39d-4e0520e29df0";
if (AppInviteDialog.canShow()) {
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(appLinkUrl)
.setPreviewImageUrl(previewImageUrl)
.build();
AppInviteDialog.show(this, content);
}
finish();
overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
progressBar = (ProgressBar)findViewById(R.id.progressbar);
guest = (ImageView)findViewById(R.id.guest);
fake = (ImageView)findViewById(R.id.fake);
progressBar.setVisibility(View.GONE);
loginButton = (LoginButton) findViewById(R.id.login_button);
loginButton.setReadPermissions(Arrays.asList("user_birthday, public_profile, email, user_friends, read_custom_friendlists"));
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
user_id = loginResult.getAccessToken().getUserId();
Log.i("USER ID", user_id);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString("facebook_id", user_id);
editor.commit();
if (loginResult.getAccessToken() != null) {
Set<String> deniedPermissions = loginResult.getRecentlyDeniedPermissions();
}
progressBar.setVisibility(View.VISIBLE);
guest.setClickable(false);
loginButton.setClickable(false);
fake.setBackgroundColor(Color.parseColor("#70000000"));
setUserInfo();
}
@Override
public void onCancel() {
Log.i("TAG2", "cancel");
info.setText("Login attempt cancelled.");
}
@Override
public void onError(FacebookException e) {
Log.i("TAG2", "error");
info.setText("Login attempt failed.");
}
});
}
开发者ID:CE-KMITL-OOAD-2015,项目名称:Move-Alarm_ORCA,代码行数:66,代码来源:LoginActivity.java
示例7: inviteFriends
import com.facebook.share.model.AppInviteContent; //导入依赖的package包/类
@Override
public void inviteFriends(String appLinkUrl, String previewImageUrl, final Callback cb) {
if (AndroidNativeUtil.getActivity() == null) {
throw new RuntimeException("Cannot invite friends while running in the background.");
}
if (AppInviteDialog.canShow()) {
AppInviteContent content = new AppInviteContent.Builder()
.setApplinkUrl(appLinkUrl)
.setPreviewImageUrl(previewImageUrl)
.build();
final CodenameOneActivity activity = (CodenameOneActivity) AndroidNativeUtil.getActivity();
if(cb == null){
AppInviteDialog.show(activity, content);
}else{
AppInviteDialog appInviteDialog = new AppInviteDialog(activity);
final CallbackManager mCallbackManager = CallbackManager.Factory.create();
activity.setIntentResultListener(new IntentResultListener() {
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
mCallbackManager.onActivityResult(requestCode, resultCode, data);
activity.restoreIntentResultListener();
}
});
appInviteDialog.registerCallback(mCallbackManager, new FacebookCallback<AppInviteDialog.Result>() {
@Override
public void onSuccess(AppInviteDialog.Result result) {
Display.getInstance().callSerially(new Runnable() {
@Override
public void run() {
cb.onSucess(null);
}
});
}
@Override
public void onCancel() {
Display.getInstance().callSerially(new Runnable() {
@Override
public void run() {
cb.onError(null, null, -1, "User Cancelled");
}
});
}
@Override
public void onError(final FacebookException e) {
Display.getInstance().callSerially(new Runnable() {
@Override
public void run() {
cb.onError(null, e, 0, e.getMessage());
}
});
}
});
appInviteDialog.show(content);
}
}
}
开发者ID:codenameone,项目名称:CodenameOne,代码行数:64,代码来源:FacebookImpl.java
示例8: show
import com.facebook.share.model.AppInviteContent; //导入依赖的package包/类
/**
* Helper to show the provided {@link com.facebook.share.model.AppInviteContent} using
* the provided Activity. No callback will be invoked.
*
* @param activity Activity to use to share the provided content
* @param appInviteContent Content of the app invite to send
*/
public static void show(
final Activity activity,
final AppInviteContent appInviteContent) {
new AppInviteDialog(activity)
.show(appInviteContent);
}
开发者ID:eviltnan,项目名称:kognitivo,代码行数:14,代码来源:AppInviteDialog.java
注:本文中的com.facebook.share.model.AppInviteContent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论