Share
Embed
Transcript
69 slides
-
About me • ࠇా ༞ੜ(@yuki.kuroda / @darquro) • 2016/5 Supershipೖࣾ
• झຯ:ΞϓϦ։ൃ 3ϲ݄Ҏ্ϦδΣΫτଓ͖ (ͱݴ͍͍ͨ) -
Ad Generation SDK • Web/App ͚ ࠂSDK • όφʔࠂ/ΠϯλʔεςΟγϟϧࠂ/ωΠ ςΟϒࠂ
• Web/iOS/Android/Unity/Cocos2d-x * ಈըϦϫʔυผSDK -
Ad Generation SDK (App) • 2013/10 v1.0.0 release • 2013/12
Unity plugin release • 2015/2 ΠϯλʔεςΟγϟϧࠂରԠ • 2015/7 SDK࿈ܞ • 2015/11 Facebook Audience Network࿈ܞ • 2016/2 RTBωΠςΟϒࠂରԠ -
ΞδΣϯμ • CocoaPodsରԠ • Clang ModulesରԠ • Swift OptionalܕରԠ •
Android AARରԠ • Maven RepositoryରԠ • ϚχϡΞϧ ϒϥογϡΞοϓ • FAQ ϒϥογϡΞοϓ iOS Android ͦͷଞ -
ొํ๏ᶃ podspecͷ࡞ Pod::Spec.new do |s| s.name = "AdGeneration" s.version =
"2.8.0" s.license = { ɹɹɹɹɹɹɹɹɹɹɹɹ :type => “Copyright", ɹɹɹɹɹɹɹɹɹɹɹɹ :text => "Copyright (c) Supership Inc. All rights reserved." ɹɹɹɹɹɹɹɹɹɹɹɹ} s.platform = :ios, "7.0" s.source = { ɹɹɹɹɹɹɹɹɹɹɹɹ :http => "https://github.com/AdGeneration/ADG-iOS-SDK/releases/ download/2.8.0/ADG.framework.zip" ɹɹɹɹɹɹɹɹɹɹɹɹ} s.vendored_frameworks = "ADG.framework" s.resources = "ADG.framework/Versions/A/Resources/ADG-Resources.bundle" s.frameworks = "SystemConfiguration", "CoreTelephony", “CoreLocation", "AVFoundation", "CoreMedia", "MediaPlayer" s.weak_framework = "AdSupport" end -
ొํ๏ᶅ push $ pod trunk push [!] Found podspec `AdGeneration.podspec`
Updating spec repo `master` warning: inexact rename detection was skipped due to too many files. warning: you may want to set your diff.renameLimit variable to at least 6046 and retry the command. CocoaPods 1.2.1.beta.1 is available. To update use: `sudo gem install cocoapods --pre` [!] This is a test version we'd love you to try. For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.2.1.beta.1 Validating podspec -> AdGeneration (2.4.3) Updating spec repo `master` -------------------------------------------------------------------------------- Congrats AdGeneration (2.4.3) successfully published April 4th, 15:53 https://cocoapods.org/pods/AdGeneration Tell your friends! ———————————————————————————————————————— -
͍ํʢΞϓϦଆʣ $ pod init # Uncomment the next line to
define a global platform for your project platform :ios, '9.0' target ‘MyApp' do use_frameworks! # Pods for MyApp pod ‘AdGeneration' end 1PEpMF $ pod install -
Clang ModuleରԠ framework module ADG { umbrella header "ADG.h" export
* module * { export * } } Modules/modul.modulemap -
Clang ModuleରԠ #import <ADG/ADGManagerViewController.h> #import <ADG/ADGInterstitial.h> #import <ADG/ADGSettings.h> #import <ADG/ADGNativeAd.h>
#import <ADG/ADGInformationIconView.h> #import <ADG/ADGMediaView.h> #import <ADG/ADGAdWebView.h> #import <ADG/ADGConstants.h> #import <ADG/ADGData.h> #import <ADG/ADGImage.h> #import <ADG/ADGLink.h> #import <ADG/ADGTitle.h> #import <ADG/ADGNativeInterfaceChild.h> #import <ADG/ADGLogger.h> #import <ADG/ADGVideo.h> Headers/ADG.h -
Clang ModuleରԠ @import ADG; @implementation ViewController @end #import <ADG/ADGManagerViewController.h> #import
<ADG/ADGNativeAd.h> @implementation ViewController @end 0CK$ͷΞϓϦͰলུՄೳʹɻ -
Swift Optional value • Null Safety • Kotlin, TypeScript, …
var str: String? str = "hoge" if let a = str { // Unwrap print(a) // => “hoge” } str = nil let b = str?.characters.count // b == nil -
Swift Optional value @interface Foo : NSObject @property (nonatomic) NSString
*bar; @end let foo = Foo() let bar = foo.bar // foo.bar: String! -> nilͷͱ͖Ϋϥογϡ 0CKD 4XJGU ࠓ·Ͱ -
Swift Optional value @interface Foo : NSObject @property (nonatomic, nullable)
NSString *bar; @end let foo = Foo() if let bar = foo.bar { // foo.bar: String? print(bar) // bar: String -> Null Safe } 4XJGU 0CKD nullableΛ͚ͭΔͱ -
ΞυδΣω ωΠςΟϒࠂ @interface ADGNativeAd : NSObject @property (nonatomic, strong, readonly)
ADGTitle *title; @property (nonatomic, strong, readonly) ADGImage *mainImage; @property (nonatomic, strong, readonly) ADGImage *iconImage; @property (nonatomic, strong, readonly) ADGData *sponsored; @property (nonatomic, strong, readonly) ADGData *desc; @property (nonatomic, strong, readonly) ADGData *ctatext; … @end 0CKD // nullableࢦఆ͕ͳ͍ͱ͖͏͔ͬΓͦͷ··ΞΫηε͢ΔͱΫϥογϡͯ͠͠·͏ let url = adgNativeAd.mainImage.url 4XJGU -
ΞυδΣω ωΠςΟϒࠂ @interface ADGNativeAd : NSObject @property (nonatomic, strong, readonly,
nullable) ADGTitle *title; @property (nonatomic, strong, readonly, nullable) ADGImage *mainImage; @property (nonatomic, strong, readonly, nullable) ADGImage *iconImage; @property (nonatomic, strong, readonly, nullable) ADGData *sponsored; @property (nonatomic, strong, readonly, nullable) ADGData *desc; @property (nonatomic, strong, readonly, nullable) ADGData *ctatext; … @end 0CKD // UnwrapͰ҆શʹΞΫηε if let url = adgNativeAd.mainImage.url { } 4XJGU -
Android AAR android { … libraryVariants.all { variant -> variant.outputs.each
{ output -> def libraryFileName = output.outputFile.name if (variant.name == android.buildTypes.release.name) { libraryFileName = libraryFileName.replace('-release', '') } libraryFileName = libraryFileName .replace(‘.aar’, "-${defaultConfig.versionName}.aar") output.outputFile = new File(output.outputFile.parent, libraryFileName) } } } w lSFMFBTFzͷআ w όʔδϣϯͷՃ BEHBBS build.gradle -
Maven RepositoryΛϩʔΧϧʹग़ྗ apply plugin: 'maven' … /** * Create Maven
repository * * add "repository" directory to project root */ uploadArchives { repositories { mavenDeployer { def repo = new File(rootDir, 'repository') repository url: "file://${repo.absolutePath}" pom.version = android.defaultConfig.versionName pom.groupId = groupId pom.artifactId = artifactId } } } build.finalizedBy(uploadArchives) build.gradle QMVHJOՃ ϩʔΧϧʹग़ྗ CVJMEλεΫͷޙʹ࣮ߦ -
Maven RepositoryΛϩʔΧϧʹग़ྗ repository └── com └── socdm └── d └──
adgeneration └── adg ├── 2.8.0 │ ├── adg-2.8.0.aar │ ├── adg-2.8.0.aar.md5 │ ├── adg-2.8.0.aar.sha1 │ ├── adg-2.8.0.pom │ ├── adg-2.8.0.pom.md5 │ └── adg-2.8.0.pom.sha1 ├── maven-metadata.xml ├── maven-metadata.xml.md5 └── maven-metadata.xml.sha1 -
ΞϓϦͰSDKͷΠϯετʔϧ allprojects { repositories { jcenter() maven { url 'https://adgeneration.github.io/ADG-Android-SDK/repository'
} } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' compile 'com.google.android.gms:play-services-ads:11.0.2' compile 'com.socdm.d.adgeneration:adg:+' } τοϓϨϕϧCVJMEHSBEMF ΞϓϦϨϕϧCVJMEHSBEMF