本文整理匯總了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);
}