Mobile 在NativeScript应用程序中注入纯Java/Obj-C代码

Mobile 在NativeScript应用程序中注入纯Java/Obj-C代码,mobile,nativescript,Mobile,Nativescript,我目前正在为Android/iOS开发一个应用程序,现在我正准备让我的用户与Facebook互动,尤其是向他们的朋友发送私人信息 Facebook为iOS实现了一个SDK: FBSDKSendButton *button = [[FBSDKSendButton alloc] init]; button.shareContent = content; [self.view addSubview:button]; 对于android: SendButton sendButton = (SendB

我目前正在为Android/iOS开发一个应用程序,现在我正准备让我的用户与Facebook互动,尤其是向他们的朋友发送私人信息

Facebook为iOS实现了一个SDK:

FBSDKSendButton *button = [[FBSDKSendButton alloc] init];
button.shareContent = content; 
[self.view addSubview:button];
对于android:

SendButton sendButton = (SendButton)findViewById(R.id.fb_send_button);
sendButton.setShareContent(shareContent);
sendButton.registerCallback(callbackManager, new FacebookCallback<Sharer.Result>() { ... });
SendButton SendButton=(SendButton)findViewById(R.id.fb\u send\u按钮);
sendButton.setShareContent(共享内容);
registerCallback(callbackManager,new FacebookCallback(){…});
但我不确定我是否可以将这些代码片段与NativeScript一起使用。 是否有人有过facebook发送按钮和NativeScript的使用经验,或者至少可以说明这是否可行


非常感谢

在中国也有类似的做法。它提供了Facebook登录功能,但我相信它很容易满足您的需要。

在中也有类似的功能。它提供了Facebook登录功能,但我相信它会很容易满足您的需要。

我上周问了一个类似的问题,并且能够使用addSubview调用进行如下操作:

var mainView = args.object.getViewById('main-view');
mainView.ios.addSubview(publisher.view);
我的XML看起来像:

<Page loaded="pageLoaded">
 <StackLayout id="main-view">
 </StackLayout>
</Page>

这是我的问题,如果您仍然处于困境,它可能会提供更多的见解:

我上周问了一个类似的问题,并且能够使用addSubview调用来执行以下操作:

var mainView = args.object.getViewById('main-view');
mainView.ios.addSubview(publisher.view);
我的XML看起来像:

<Page loaded="pageLoaded">
 <StackLayout id="main-view">
 </StackLayout>
</Page>
这是我的问题,如果您仍处于困境,可能会提供更多的见解: