how to open an Instagram page by as3 in android air application?

假装没事ソ 提交于 2019-12-24 05:05:16

问题


i want open an instagram page by clicking on a button in my app, for example "instagram/mypage" in Instagram app. whats the code?

mybuttun.addEventListener(MouseEvent.CLICK, open_instagram_page);
function open_instagram_page(event:MouseEvent)
{
    //what should i write here?
}

i found this code that open "setting" page of android device,how change it to open specific page on instagram app:

var url:String = ("intent:#Intent;" +
                  "action=android.intent.action.MAIN;" +
                  "category=android.intent.category.LAUNCHER;" +
                  "component=com.android.settings/.Settings;" +
                  "end");
navigateToURL(new URLRequest(url));

回答1:


You can use the Share ANE to do open the Instagram app to a specific page. The following works on Android and iOS:

var app:Application = new Application( "com.instagram.android", "instagram://" );

var options:ApplicationOptions = new ApplicationOptions();
options.action = ApplicationOptions.ACTION_VIEW;
options.data = "http://instagram.com/_u/distriqt";
options.parameters = "user?username=distriqt";

if (Share.service.applications.isInstalled( app ))
{
    Share.service.applications.launch( app, options );
}

I'm one of the developers of this ANE.




回答2:


You have to choose Air Native Extension (ANE),
that's very simple, first verify that Instagram is Installed, then just write native codes for that purpose and let AIR communicate between AS3 and Android machine.

the native code could be Java (for Android) and Objective-c (for IOS)

for beginning take a look at this official tutorial
also there is another Documentation around ANE



来源:https://stackoverflow.com/questions/42601223/how-to-open-an-instagram-page-by-as3-in-android-air-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!