IOS Ane Implant Process

Source: Internet
Author: User

Source: Http://www.adsmogo.com/help/iosANE

First, the IOS ane implant process

Step 1: Create Flex Project 1.1 to launch Flash Builder 4.6.0, select "File", "New", "Flex Mobile Project" as shown in:

1.2 After completing project name, click "Next" to enter the interface shown below:

1.3 Target platforms only tick "Apple IOS" and then click "Finish" to complete the project creation. Step 2: Configure Item 2.1 Select the item and right-click. In the popup menu, select "Run as", "Run configurations ..." to enter the following view:

2.2 Click "Run" and the Flash simulator will run. The following interface appears to complete the Flex project creation.
Step 3: Add ANE3.1 Right-click to select Project, select "Properties", select "Flex Build Path", "Native Extensions" in the following screen, and tap "Add ANE ..."

3.2 Eject the Ane file selection path, click Browse ... Locate the ANE path and add the Ane file.

After 3.3 Click "OK", you can see the added ane in native extensions. As shown in the following:
Step 4: Configure the certificate, configure the IOS SDK path 4.1 Select "Flex Build packaging", "Apple IOS", "Digital Signature", configure certificate, Provisioning file path.

4.2 Select Native Extensions, select Package. Then click "Browse ..." to the right of the Apple iOS SDK and select the IOS SDK path. When the configuration is complete, click OK. Such as:
Step 5: Place the Lbssdk.framework in the system framework of the SDK selected in step 4 as an example of the IOS5 SDK:
IOS5 SDK Path
/developer/platforms/iphoneos.platform/developer/sdks/iphoneos5.0.sdk
Then it will be put in
/developer/platforms/iphoneos.platform/developer/sdks/iphoneos5.0.sdk/system/library/frameworks/step 6: Edit AD Code Select the Mxml file under Src/views in the project, open to edit, add the following code:
<?xml version= "1.0" encoding= "Utf-8"?>
<s:view xmlns:fx= "http://ns.adobe.com/mxml/2009"
xmlns:s= "Library://ns.adobe.com/flex/spark" title= "Adsmogoview"
Creationcomplete= "Setupadsmogoview (event)"
>
<fx:Declarations>
<!--place non-visual elements (e.g., services, value objects) here---
</fx:Declarations>

<fx:Script>
<! [cdata[
Import Com.adsmogo.AdsMoGoView;
Import mx.events.FlexEvent;
Import spark.events.ViewNavigatorEvent;
private Var Adsmogoview:adsmogoview;

protected function Setupadsmogoview (event:flexevent): void{
try{
Adsmogoview = new Adsmogoview ();
Adsmogoview.initadview ("ad01030cffa44cab9a664a6ed3f52325", Adsmogoview.adviewtypenormalbanner,false);
Adsmogoview.setadsmogovieworigin (0,50);
}
catch (E:error) {}
}

protected function Releaseadsmogoview (event:viewnavigatorevent): void
{
try {
Adsmogoview.releaseadsmogoview ();
} catch (E:error) {}
}
]]>
</fx:Script>
</s:View>
Step 7: Package Build ipa7.1 Right-select "Run as", "Run configurations ..." and select "on Device" in the pop-up window as shown in:

7.2 Click "Run", the pop-up window asks for a password, as shown in:

7.3 After you enter the certificate password, wait for the package to complete, as shown in:

7.4 Packing complete the following window appears:

7.5 Locate the IPA file in the project "Bin-debug" Directory of the project, as shown in:

7.6 Install the. IPA to the real machine and run.

Second, Adsmogo IOS ANE API Description 1. Adsmogoview Method 1.1 instance method
public function initAdView(ak:String, adType:int,
expressMode:Boolean):AdsMoGoView

ak:芒果ID,在芒果网站上注册app时生成。
adType 类型:
public static const AdViewTypeNormalBanner:int = 1;
public static const AdViewTypeLargeBanner:int = 2;
public static const AdViewTypeMediumBanner:int = 3;
public static const AdViewTypeRectangle:int =4;
public static const AdViewTypeiPadNormalBanner:int = 8;
AdViewTypeNormalBanner 适用于iphone、ipod touch
AdViewTypeLargeBanner 适用于ipad
AdViewTypeMediumBanner适用于ipad
AdViewTypeRectangle 适用于ipad
AdViewTypeiPadNormalBanner 适用于ipad
expressMode:是否快速模式。false 非快速模式,true 快速模式。
1.2 Releasing Ads
public function releaseAdsMoGoView():void
1.3 Set AD Display or hide
public function setAdsMoGoViewOrigin(x:int, y:int):void
1.4 Setting up AD locations
public function setAdsMoGoViewHidden(hidden:Boolean):void

2. Adsmogoevent
Event Type Event Description
Adsmogo_srartad Ad Start Request
Adsmogo_receivead AD Receive failed
Adsmogo_failgotad Advertising bye
Adsmogo_clickad Ad clicks
Adsmogo_colsead Ads off
Adsmogo_presentfull Advertising Full Screen display
Adsmogo_dismissfull Ad Full Screen disappears
Adsmogo_webbrowserwillappear Mango Browser Pre-display callback
Adsmogo_webbrowserdidappear Mango Browser Show
Adsmogo_webbrowserwillcolsed Mango Browser before closing callback
Adsmogo_webbrowserdidclosed Mango Browser Off
Adsmogo_webbrowsershare Mango Browser Share
Use the method reference as follows (as with adding an event listener):
Adsmogoview.addeventlistener (Adsmogoevent.adsmogo_clickad,admogoeventsfun);
Adsmogoview.addeventlistener (Adsmogoevent.adsmogo_receivead,admogoeventsfun);

Protected function Admogoeventsfun (event:adsmogoevent): void{
Trace (event.admogolevel+ Event.admogoresult);
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.