本文整理汇总了Java中com.facebook.react.ReactActivity类的典型用法代码示例。如果您正苦于以下问题:Java ReactActivity类的具体用法?Java ReactActivity怎么用?Java ReactActivity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReactActivity类属于com.facebook.react包,在下文中一共展示了ReactActivity类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initSession
import com.facebook.react.ReactActivity; //导入依赖的package包/类
public static void initSession(Uri uri, ReactActivity reactActivity) {
Branch branch = Branch.getInstance();
branch.initSession(new Branch.BranchReferralInitListener(){
private ReactActivity mActivity = null;
@Override
public void onInitFinished(JSONObject referringParams, BranchError error) {
Log.d(REACT_CLASS, "onInitFinished");
JSONObject result = new JSONObject();
try{
result.put("params", referringParams != null ? referringParams : JSONObject.NULL);
result.put("error", error != null ? error.getMessage() : JSONObject.NULL);
} catch(JSONException ex) {
try {
result.put("error", "Failed to convert result to JSONObject: " + ex.getMessage());
} catch(JSONException k) {}
}
initSessionResult = result;
LocalBroadcastManager.getInstance(mActivity).sendBroadcast(new Intent(NATIVE_INIT_SESSION_FINISHED_EVENT));
}
private Branch.BranchReferralInitListener init(ReactActivity activity) {
mActivity = activity;
return this;
}
}.init(reactActivity), uri, reactActivity);
}