我一直在看分支SDK文档已经有一段时间了,虽然它们似乎涵盖了每个基础,但很多看起来对我来说都很模糊。
我的应用不是(目前)面向内容的。换句话说,它更像是一个实用程序应用程序而不是UGC应用程序(至少目前是这样。未来我计划引入更多内容,但现在并不真正相关)。
我目前使用Fabric进行分析(以及Firebase),我正在尝试设置基本的共享/引荐系统:
这是我目前正在测试的共享操作。所有分支文档都使用共享特定内容的示例 - 但我不想要这样! 我试图找出如何配置/更改设置以共享应用程序本身,而不是应用程序中的某些内容。我已经从React Native文档中复制了这个作为开头,做了一些有意义的调整,但现在我感到迷茫。
componentDidMount()
如何完成此设置以共享应用程序?
我已经在仪表板上设置了所有内容(URI方案,分支键,通用链接,应用链接等等),我也按照{{{}中的文档建议在我的应用中初始化了分支。 1}} this._unsubscribeFromBranch = Branch.subscribe(({ error, params }) => {
if (error) {
console.error('Error from Branch: ' + error);
return;
}
// params will never be null if error is null
console.log('Branch params: ' + JSON.stringify(params));
if (params['+non_branch_link']) {
const nonBranchUrl = params['+non_branch_link'];
console.log('non-Branch link URL: ' + nonBranchUrl);
// Route non-Branch URL if appropriate.
return;
}
if (!params['+clicked_branch_link'])
return;
// Get title and url for route
let title = params.$og_title;
let url = params.$canonical_url;
let image = params.$og_image_url;
// Now push the view for this URL
this.navigator.push({ title: title, url: url, image: image });
});
:
Branch.setIdentity(...)
(P.S。我应该在认证流程之后将其移至?我已经将npm
置于认证流程之后)
这些是我使用
"react-native": "0.50.3"
"react": "16.0.0"
"react-native-branch": "2.1.1"
"react-native-fbsdk": "0.6.3"
"react-native-fabric": "0.5.1"
软件包
public class Register_Page extends Activity {
int from_Where_I_Am_Coming = 0;
private no.nordicsemi.android.nrftoolbox.myDbAdapter mydb ;
Button b1,b2;
TextView name ;
TextView email;
TextView pass;
TextView dob;
TextView gender;
TextView phone;
TextView city;
int id_To_Update = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register__page);
name = (TextView) findViewById(R.id.editText_name);
phone = (TextView) findViewById(R.id.editText_phone);
email = (TextView) findViewById(R.id.editText_email);
pass = (TextView) findViewById(R.id.editText_pass);
dob = (TextView) findViewById(R.id.editText_dob);
gender=(TextView)findViewById(R.id.editText_gender);
city=(TextView)findViewById(R.id.editText_city);
b1=(Button)findViewById(R.id.button_register);
b2=(Button)findViewById(R.id.button_view);
mydb = new no.nordicsemi.android.nrftoolbox.myDbAdapter(this);
public void addUser(View view) {
if(mydb.insertContact(name.getText().toString(), email.getText().toString(),
pass.getText().toString(), dob.getText().toString(),
gender.getText().toString(),phone.getText().toString(),city.getText().toString())){
Toast.makeText(getApplicationContext(), "done",
Toast.LENGTH_SHORT).show();
} else{
Toast.makeText(getApplicationContext(), "not done",
Toast.LENGTH_SHORT).show();
}
}
}
public void getmydata(View v){
Intent intent =new Intent();
intent.setClass(this ,View_Profile.class);
startActivity(intent);
}
如果我错过任何重要信息,请随时提出更多信息。谢谢! :)