我已经成功地将Scringo集成到我的安卓app.However中,我想在成功注册、登录和注销后在运行时做一些事情。我该怎么做呢?请帮帮忙。我已经在谷歌上搜索过了,但没有结果。我也联系了Scringo团队,但还没有收到他们的消息。提前感谢
发布于 2013-11-20 22:10:14
披露:我为Scringo工作;-)并且没有收到你的电子邮件...下次尝试使用support@scringo.com
在Android中:创建一个广播接收器:
public class MyReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals("com.scringo.LoginBroadcast")) {
String userId = intent.getExtras().getString("userId");
String accountId = intent.getExtras().getString("accountId");
ScringoLogger.e("Got receiver: " + accountId + ", " + userId);
}
}
}并将其注册到清单中:
<receiver android:name="com.example.MyReceiver">
<intent-filter>
<action android:name="com.scringo.LoginBroadcast" />
<category android:name="com.example" />
</intent-filter>
</receiver>添加了这个:http://docs.scringo.com/android-guides/popular/handling-login-status-changes/
在iOS中,它甚至更简单,你在Scringo.h中定义了"kNotificationUserSignInChanged“,你应该向它添加一个观察者,你会收到一个通知:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusChanged) name:kNotificationUserSignInChanged object:nil];希望这能有所帮助
https://stackoverflow.com/questions/20094390
复制相似问题