Difference between revisions of "IOS SDK Getting Start"

From AdLocus
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 11: Line 11:
  
 
== 取得您的 App Key ==
 
== 取得您的 App Key ==
−
** 至 http://adlocus.com/ 申請帳號並登入。
+
* 至 http://adlocus.com/ 申請帳號並登入。
−
** 在「應用程式」中「新增」您的應用程式並取得app key。
+
* 在「應用程式」中「新增」您的應用程式並取得app key。
  
 
== 準備將 SDK 加入到您的專案 ==
 
== 準備將 SDK 加入到您的專案 ==
 
* [[iOS_AddSDK|加入SDK]]
 
* [[iOS_AddSDK|加入SDK]]
 +
* 確保您的每個版位都實作了 - (NSString *)AdLocusAppKey
  
 
== InApp ==
 
== InApp ==
Line 29: Line 30:
 
* [[iOS_Video|詳細說明]]
 
* [[iOS_Video|詳細說明]]
  
−
== Proguard ==
+
== Location based ==
−
您的專案若有透過 Proguard 進行混淆,請加入下列設定檔維持相容性。
+
* 當您的 App 有實作 Location Manager 時, 我們建議您透過實作下列 delegate 取得 Location-based Ad.
−
 
+
<syntaxhighlight lang="objc">
−
<syntaxhighlight lang="java">
+
-(CLLocation *)locationInfo
−
-keep public class com.adlocus.** {*;}
+
{
−
-keep class com.adlocus.adapters.AdLocusAdapter$MyJavaScriptInterface{<methods>;}
+
    return locationManager.location;
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 41: Line 43:
  
 
== 測試模式與觀眾定向(Optional) ==
 
== 測試模式與觀眾定向(Optional) ==
−
當您完成 SDK 整合後,您可透過設定下列參數開啟測試模式(測試模式下的互動在平台上將不記錄).
+
當您完成 SDK 整合後,您可透過設定下列 Delegate 開啟測試模式(測試模式下的互動在平台上將不記錄).
−
* 年齡
+
* 年齡: - (NSNumber *)age; 
−
* 生日
+
* 性別: - (NSString *)gender; // user's gender (e.g. @"1" is Male or @"2" is Female)
−
* 性別
+
* 測試模式: - (BOOL)testMode;
−
* 測試模式
+
−
 
+
−
<syntaxhighlight lang="java">
+
−
// 設定使用者年齡 (也可使用 setBirthday())
+
−
void setAge(int age)
+
−
void setBirthDate(GregorianCalendar birthday))
+
−
void setGender(AdLocusTargeting$Gender gender)
+
−
void setTestMode(boolean isTesting)
+
−
 
+
−
// 設置範例:
+
−
AdLocusTargeting targeting = new AdLocusTargeting();
+
−
targeting.setAge(23);
+
−
targeting.setBirthDate(new GregorianCalendar(1990, 12, 29));
+
−
targeting.setGender(AdLocusTargeting$Gender.MALE);
+
−
targeting.setTestMode(true);  //使用測試模式
+
−
</syntaxhighlight>
+
−
 
+
−
=== 開啟測試/定向 ===
+
−
 
+
−
==== InApp ====
+
−
<syntaxhighlight lang="java">
+
−
AdLocusLayout adlocusLayout1 =  new AdLocusLayout(this,
+
−
AdLocusLayout.AD_SIZE_IAB_MRECT,
+
−
appKey,
+
−
15,
+
−
targeting);
+
−
</syntaxhighlight>
+
−
 
+
−
==== Promotion ====
+
−
<syntaxhighlight lang="java">
+
−
AdLocusTargeting.enablePush(this, app key, targeting);
+
−
</syntaxhighlight>
+

Latest revision as of 14:07, 9 October 2014

Getting Start with AdLocus

以下將說明您怎麼整入 AdLocus SDK.

自我檢查

  • 已整入 Lib Folder(Y/N)
  • 已設定 Framework (Y/N)
  • 已加入權限到 Info.plist 中 (Y/N)

若您已完成上述檢查卻無法正確啟用相關服務, 請來信 support@adlocus.com , 我們將有專人與您聯繫.

取得您的 App Key

  • 至 http://adlocus.com/ 申請帳號並登入。
  • 在「應用程式」中「新增」您的應用程式並取得app key。

準備將 SDK 加入到您的專案

  • 加入SDK
  • 確保您的每個版位都實作了 - (NSString *)AdLocusAppKey

InApp

Promotion

Interstitial

Video

Location based

  • 當您的 App 有實作 Location Manager 時, 我們建議您透過實作下列 delegate 取得 Location-based Ad.
-(CLLocation *)locationInfo
{
    return locationManager.location;
}

AdMob Mediation

測試模式與觀眾定向(Optional)

當您完成 SDK 整合後,您可透過設定下列 Delegate 開啟測試模式(測試模式下的互動在平台上將不記錄).

  • 年齡: - (NSNumber *)age;
  • 性別: - (NSString *)gender; // user's gender (e.g. @"1" is Male or @"2" is Female)
  • 測試模式: - (BOOL)testMode;