如何从Automate App发送Glympse

时间:2016-10-24 05:41:38

标签: android-activity glympse

从应用Automate,我想发送Glympse。自动化const App = () => { return ( <Router navigationBarStyle={styles.navBar} titleStyle={styles.navTitle} sceneStyle={styles.routerScene} barButtonIconStyle={styles.barButton} > <Scene key="root"> <Scene key="login" component={Login} title="Login" hideNavBar = {true} initial /> <Scene key="recipes" component={Recipes} title="Recipes" hideNavBar = {false} hideBackImage = {false} //backButtonImage = {require('image!ui_nav_bar_hamburgher_icon')} onBack = {() =>{return null;}} rightTitle = "Bad Hombres" onRight = {() => { Alert.alert( 'No puppet, No puppet', 'You\'re the puppet!',)}} leftTitle ="Bigly" onLeft = {() => {Alert("Such a nasty woman..")}} // leftButtonImage={require('image!ui_login_email_icon')} panHandlers ={null} /> </Scene> </Router> ); } 块采用以下输入。我假设不是所有这些都必须指定。

  • 封装
  • 活动类
  • 动作
  • 数据URI
  • Mime Type
  • 分类
  • 附加功能
  • 标志

我应该为上述值设置什么?

我正在阅读一些code并查看一些documentation。我发现App Start应该是Packagecom.glympse.android.glympse应该是Activity Classcom.glympse.android.intent.Create输入应设置为字典对象。字典应该有一个带有字符串值的extras键。 message键具有long值,该值保存共享位置的毫秒数。我还没弄明白其余的按键或格式。

1 个答案:

答案 0 :(得分:1)

以下是步骤......

  • 使用以下键创建名为recipient的字典:
    • type,字符串值为sms
    • address,字符串值为5425551212 //替换为实际的电话号码
  • 使用以下键创建另一个名为options的字典:
    • recipients,字符串值为jsonEncode(recipient) //这会将recipient字典转换为JSON字符串
    • message,字符串值为whatever you want to say
    • duration,用于分享Glympse位置的长毫秒数(例如1800000,持续30分钟)
  • 使用带有以下输入的App Start块:
    • Package设置为com.glympse.android.glympse
    • Activity Class设置为com.glympse.android.intent.Create
    • Action设置为Run
    • Extras设置为options //上面创建的词典

这将导致Glympse屏幕显示,以便用户只需点击Create按钮。