Skip to content

Commit

Permalink
- maio iOS SDK 1.1.7 を公開。
Browse files Browse the repository at this point in the history
- サンプルアプリを作成。
  • Loading branch information
im-kashi committed Nov 9, 2016
1 parent 80407a7 commit 1559579
Show file tree
Hide file tree
Showing 19 changed files with 1,132 additions and 7 deletions.
62 changes: 62 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xcuserstate

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
99 changes: 99 additions & 0 deletions Maio.framework/Headers/Maio.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
//
// Maio.h
// Maio
//
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import <sys/sysctl.h>
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_5_0
#import <AdSupport/AdSupport.h> // idfaの取得 用
#endif
#import <Maio/MaioDelegate.h>

@class MaioInstance;

@interface Maio: NSObject

/**
* maio SDK のバージョンを返します。
*/
+ (NSString *)sdkVersion;

/**
* 広告の配信テストを行うかどうかを設定します。
*
* @param adTestMode 広告のテスト配信を行う場合には YES、それ以外なら NO。アプリ開発中は YES にし、ストアに提出する際には NO にして下さい(既定値は NO)。
*/
+ (void)setAdTestMode:(BOOL)adTestMode
#ifndef DEBUG
__attribute__((deprecated("Deprecated on Release build")))
#endif
;

/// maio SDK からの通知を受け取るデリゲート
+ (id<MaioDelegate>)delegate;
/// maio SDK からの通知を受け取るデリゲートをセットします。
+ (void)setDelegate:(id<MaioDelegate>)delegate;

/**
* SDK のセットアップを開始します。
*
* @param mediaId 管理画面にて発行されるアプリ識別子
* @param delegate SDK からの通知を受け取るデリゲート。通知を受け取る必要がない場合は nil を渡します。
*/
+ (void)startWithMediaId:(NSString *)mediaId delegate:(id<MaioDelegate>)delegate;

/**
* 既定のゾーンの広告表示準備が整っていれば YES、そうでなければ NO を返します。
*/
+ (BOOL)canShow;

/**
* 指定したゾーンの広告表示準備が整っていれば YES、そうでなければ NO を返します。
*
* @param zoneId 広告の表示準備が整っているか確認したいゾーンの識別子
*/
+ (BOOL)canShowAtZoneId:(NSString *)zoneId;

/**
* 既定のゾーンの広告を表示します。
*/
+ (void)show;

/**
* 指定したゾーンの広告を表示します。
*
* @param zoneId 広告を表示したいゾーンの識別子
*/
+ (void)showAtZoneId:(NSString *)zoneId;


+ (void)showWithViewController:(UIViewController *)vc;
+ (void)showAtZoneId:(NSString *)zoneEid vc:(UIViewController *)vc;

+ (MaioInstance *)startWithNonDefaultMediaId:(NSString *)mediaEid delegate:(id<MaioDelegate>)delegate;

@end


@interface MaioInstance : NSObject

@property (nonatomic, readonly) NSString *mediaId;
@property (nonatomic) BOOL adTestMode;
@property (nonatomic) id<MaioDelegate> delegate;

- (BOOL)canShow;
- (BOOL)canShowAtZoneId:(NSString *)zoneId;
- (void)show;
- (void)showAtZoneId:(NSString *)zoneId;

- (void)showWithViewController:(UIViewController *)vc;
- (void)showAtZoneId:(NSString *)zoneEid vc:(UIViewController *)vc;

@end

92 changes: 92 additions & 0 deletions Maio.framework/Headers/MaioDelegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// MaioDelegate.h
// Maio
//
//
//

/**
* maio SDK のエラー種別(アプリ側への通知内容)
*/
typedef NS_ENUM(NSInteger, MaioFailReason) {
/// 不明なエラー
MaioFailReasonUnknown = 0,
/// 広告在庫切れ
MaioFailReasonAdStockOut,
/// ネットワーク接続エラー
MaioFailReasonNetworkConnection,
/// HTTP status 4xx クライアントエラー
MaioFailReasonNetworkClient,
/// HTTP status 5xx サーバーエラー
MaioFailReasonNetworkServer,
/// SDK エラー
MaioFailReasonSdk,
/// クリエイティブダウンロードのキャンセル
MaioFailReasonDownloadCancelled,
/// 動画再生エラー
MaioFailReasonVideoPlayback,
};


/**
* maio SDK からの通知を受け取るデリゲート
*/
@protocol MaioDelegate <NSObject>

@optional

/**
* 全てのゾーンの広告表示準備が完了したら呼ばれます。
*/
- (void)maioDidInitialize;

/**
* 広告の配信可能状態が変更されたら呼ばれます。
*
* @param zoneId 広告の配信可能状態が変更されたゾーンの識別子
* @param newValue 変更後のゾーンの状態。YES なら配信可能
*/
- (void)maioDidChangeCanShow:(NSString *)zoneId newValue:(BOOL)newValue;

/**
* 広告が再生される直前に呼ばれます。
* 最初の再生開始の直前にのみ呼ばれ、リプレイ再生の直前には呼ばれません。
*
* @param zoneId 広告が表示されるゾーンの識別子
*/
- (void)maioWillStartAd:(NSString *)zoneId;

/**
* 広告の再生が終了したら呼ばれます。
* 最初の再生終了時にのみ呼ばれ、リプレイ再生の終了時には呼ばれません。
*
* @param zoneId 広告を表示したゾーンの識別子
* @param playtime 動画の再生時間(秒)
* @param skipped 動画がスキップされていたら YES、それ以外なら NO
* @param rewardParam ゾーンがリワード型に設定されている場合、予め管理画面にて設定してある任意の文字列パラメータが渡されます。それ以外の場合は nil
*/
- (void)maioDidFinishAd:(NSString *)zoneId playtime:(NSInteger)playtime skipped:(BOOL)skipped rewardParam:(NSString *)rewardParam;

/**
* 広告がクリックされ、ストアや外部リンクへ遷移した時に呼ばれます。
*
* @param zoneId 広告がクリックされたゾーンの識別子
*/
- (void)maioDidClickAd:(NSString *)zoneId;

/**
* 広告が閉じられた際に呼ばれます。
*
* @param zoneId 広告が閉じられたゾーンの識別子
*/
- (void)maioDidCloseAd:(NSString *)zoneId;

/**
* SDK でエラーが生じた際に呼ばれます。
*
* @param zoneId エラーに関連するゾーンの識別子
* @param reason エラーの理由を示す列挙値
*/
- (void)maioDidFail:(NSString *)zoneId reason:(MaioFailReason)reason;

@end
Binary file added Maio.framework/Info.plist
Binary file not shown.
Binary file added Maio.framework/Maio
Binary file not shown.
6 changes: 6 additions & 0 deletions Maio.framework/Modules/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
framework module Maio {
umbrella header "Maio.h"

export *
module * { export * }
}
Loading

0 comments on commit 1559579

Please sign in to comment.