Slide 1

Slide 1 text

࢖͍΍͍͢SDKΛ໨ࢦͯ͠ ΍͖ͬͯͨ͜ͱ SDKνʔϜ ࠇా

Slide 2

Slide 2 text

About me • ࠇా ༞ੜ(@yuki.kuroda / @darquro) • 2016/5 Supershipೖࣾ • झຯ:ΞϓϦ։ൃ 3ϲ݄Ҏ্ϦδΣΫτଓ͖ (ͱݴ͍͍ͨ)

Slide 3

Slide 3 text

ຊ୊

Slide 4

Slide 4 text

ͷલʹ

Slide 5

Slide 5 text

Ad Generation SDK • Web/App ޲͚ ޿ࠂSDK • όφʔ޿ࠂ/ΠϯλʔεςΟγϟϧ޿ࠂ/ωΠ ςΟϒ޿ࠂ • Web/iOS/Android/Unity/Cocos2d-x * ಈըϦϫʔυ͸ผSDK

Slide 6

Slide 6 text

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ωΠςΟϒ޿ࠂରԠ

Slide 7

Slide 7 text

Ad Generation SDK (App) ࣄۀͷٸ੒௕ʹ൐͍ɺػೳվྑʹॏ఺Λஔ͍ͯ ͍ͨɻ ΞϓϦ։ൃͷ؀ڥͷมԽ·Ͱ͸௥͑ͯͳ͔ͬͨɻ

Slide 8

Slide 8 text

ΞϓϦ։ൃ؀ڥͷมԽ(2013~) • ৽ݴޠͷొ৔(Swift) • ৽IDEͷొ৔(Android Studio) • ύοέʔδ؅ཧπʔϧͷීٴ

Slide 9

Slide 9 text

ͦ͜Ͱ • ݱࡏͷ։ൃ؀ڥɾݴޠʹԊͬͨSDKʹ͍ͯ͠ ͖͍ͨ

Slide 10

Slide 10 text

΍ͬͱຊ୊

Slide 11

Slide 11 text

ػೳվྑ΍ෆ۩߹मਖ਼Ҏ֎ʹ SDKͷ࢖͍΍͢͞޲্ͷͨʹ ΍͖ͬͯͨ͜ͱͷ࿩

Slide 12

Slide 12 text

ΞδΣϯμ • CocoaPodsରԠ • Clang ModulesରԠ • Swift OptionalܕରԠ • Android AARରԠ • Maven RepositoryରԠ • ϚχϡΞϧ ϒϥογϡΞοϓ • FAQ ϒϥογϡΞοϓ iOS Android ͦͷଞ

Slide 13

Slide 13 text

CocoaPodsରԠ

Slide 14

Slide 14 text

CocoaPods • iOSϓϩδΣΫτͷύοέʔδ؅ཧπʔϧ • ଞʹ΋Carthage(ΑΓγϯϓϧ)ɺSwift Package Manager(AppleެࣜɺϚϧνϓϥο τϑΥʔϜ)ͳͲ͕͋Δ

Slide 15

Slide 15 text

SDKखಈΠϯετʔϧͷ৔߹ • GitHub͔ΒzipΛμ΢ϯϩʔυ • XcodeʹϥΠϒϥϦͱͯ͠௥Ճ • ґଘframeworkΛϚχϡΞϧΛ֬ೝ͠ͳ͕Β ௥Ճ

Slide 16

Slide 16 text

ొ࿥ํ๏ᶃ 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

Slide 17

Slide 17 text

ొ࿥ํ๏ᶄϢʔβʔ࡞੒ $ pod trunk register [email protected] ‘AdGeneration’ ϝʔϧ͕ಧ͍ͯɺΞΫςΟϕʔγϣϯͨ͠Β׬ྃ

Slide 18

Slide 18 text

ొ࿥ํ๏ᶅ 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! ————————————————————————————————————————

Slide 19

Slide 19 text

࢖͍ํʢΞϓϦଆʣ $ 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

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Clang ModulesରԠ

Slide 22

Slide 22 text

Clang Modules • Clangͷػೳ • ϔομʔϑΝΠϧΛ·ͱΊΒΕΔ • SwiftͰϥΠϒϥϦΛ࡞Δ৔߹͸ɺࣗಈతʹ ModulesԽ͞ΕΔ

Slide 23

Slide 23 text

ࠓ·ͰSwiftΞϓϦͰ ΞυδΣωSDKΛ࢖͏৔߹ ΞϓϦଆͰ#SJEHFIFBEFSϑΝΠϧΛ࡞੒͠ɺඞཁͳϔομʔϑΝΠϧͷهड़͕ඞཁ #import #import #import #import

Slide 24

Slide 24 text

Clang ModuleରԠ framework module ADG { umbrella header "ADG.h" export * module * { export * } } Modules/modul.modulemap

Slide 25

Slide 25 text

Clang ModuleରԠ #import #import #import #import #import #import #import #import #import #import #import #import #import #import #import Headers/ADG.h

Slide 26

Slide 26 text

Clang ModuleରԠ import ADG class ViewController: UIViewController { } 4XJGUΞϓϦଆͰ#SJEHFIFBEFSϑΝΠϧ͸ෆཁʹɻ

Slide 27

Slide 27 text

Clang ModuleରԠ @import ADG; @implementation ViewController @end #import #import @implementation ViewController @end 0CK$ͷΞϓϦͰ΋লུՄೳʹɻ

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Swift OptionalܕରԠ

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

Swift Optional value @interface Foo : NSObject @property (nonatomic) NSString *bar; @end let foo = Foo() let bar = foo.bar // foo.bar: String! -> nilͷͱ͖Ϋϥογϡ 0CKD 4XJGU ࠓ·Ͱ͸

Slide 32

Slide 32 text

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Λ͚ͭΔͱ

Slide 33

Slide 33 text

ΞυδΣω ωΠςΟϒ޿ࠂ @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

Slide 34

Slide 34 text

ΞυδΣω ωΠςΟϒ޿ࠂ @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

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

Android AARରԠ

Slide 37

Slide 37 text

AndroidϥΠϒϥϦ • JARܗࣜ • AARܗࣜ -> javaͷclassesϑΝΠϧ͚ͩ͡Όͳ͘ɺAndroidManifest.xmlͳ Ͳ΋ؚΊΒΕΔ

Slide 38

Slide 38 text

Android AAR • ී௨ʹAndroid StudioͰϥΠϒϥϦϓϩδΣ ΫτΛ࡞੒ͯ͠Ϗϧυ͢Ε͹উखʹग़དྷΔ ./{module}/build/outputs/aar • ΞυδΣω͸Eclipse࣌୅͔ΒͷҠߦͷͨΊjar ΋Ϗϧυͯ͠࡞͍ͬͯͨ

Slide 39

Slide 39 text

Android AAR ͨͩ͠ɺͦͷ··ͩͱɺ • {module}-release.aar • {module}-debug.aar Έ͍ͨͳ໊લʹͳΔͷͰɺόʔδϣϯ൪߸΍ɺ ϦϦʔεϏϧυ࣌͸”release”͸আ֎͍ͨ͠ɻ

Slide 40

Slide 40 text

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

Slide 41

Slide 41 text

Android AAR ./adg/build/outputs/aar ├── adg-2.8.0.aar └── adg-debug-2.8.0.aar

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

Maven RepositoryରԠ

Slide 44

Slide 44 text

SDKखಈΠϯετʔϧͷ৔߹ • GitHub͔ΒaarΛμ΢ϯϩʔυ • Android StudioͰϞδϡʔϧొ࿥ • ΞϓϦͷdependenciesʹ௥Ճ

Slide 45

Slide 45 text

Apache Maven • Java༻ϓϩδΣΫτ؅ཧπʔϧ • Apache Antͷ୅ΘΓͱͯ͠࡞ΒΕͨ

Slide 46

Slide 46 text

AndroidϥΠϒϥϦͷެ։ ֎෦ͷϦϙδτϦ • Bintray jCenter • Maven Central jCenterͩͱֹ݄ར༻ྉ͕݁ߏߴ͍ʢ$150/monthʣ

Slide 47

Slide 47 text

AndroidϥΠϒϥϦͷެ։ ʲAndroidʳ.aarΛGitHub PagesΛ࢖ͬͯެ։͢Δ http://tech.admax.ninja/2014/09/30/how-to-publish-to-github-pages-the- aar-of-customview/ GitHub PagesΛ࢖ͬͯެ։Ͱ͖Δ • ແྉ • ݩʑSDKμ΢ϯϩʔυ༻ʹ࢖ͬͯΔ

Slide 48

Slide 48 text

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λεΫͷޙʹ࣮ߦ

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

GitHub Pagesʹpush

Slide 51

Slide 51 text

ΞϓϦͰ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

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

ϚχϡΞϧϒϥογϡΞοϓ

Slide 54

Slide 54 text

ϚχϡΞϧʹGitHub wiki

Slide 55

Slide 55 text

2016/2 ࣌఺ͷτοϓ

Slide 56

Slide 56 text

2016/2 ࣌఺ͷτοϓ •ϓϥοτϑΥʔϜɺ޿ࠂϑΥʔϚο τɺΞυωοτϫʔΫ͕ࠞࡏ •ུশ •ಋೖॱ൪͕Θ͔Βͳ͍

Slide 57

Slide 57 text

ݱࡏͷτοϓ

Slide 58

Slide 58 text

ݱࡏͷτοϓ ޿ࠂϑΥʔϚοτ͝ͱʹେ߲໨Λ෼ྨ αΠυϝχϡʔΛ௥Ճ ϓϥοτϑΥʔϜ͝ͱʹϚχϡΞϧΛ෼཭ શͯͷϚχϡΞϧʹτοϓ͔Βߦ͚Δ Α͏ಋઢΛෑ͍ͨ

Slide 59

Slide 59 text

ݱࡏͷτοϓ 4%,࿈ܞʹ͍ͭͯͷৄ͍͠આ໌ͱɺ֤Ξυωο τϫʔΫʹ͍ͭͯͷઆ໌΋௥Ճ

Slide 60

Slide 60 text

֤छϚχϡΞϧͷมߋ *%&ͷૢ࡞ͷ෦෼͸ը૾Ͱઆ໌ چ ৽

Slide 61

Slide 61 text

֤छϚχϡΞϧͷมߋ ίʔυϒϩοΫ͸γϯλοΫεϋΠϥΠτ Λ͚ͭΔ چ ৽

Slide 62

Slide 62 text

֤छϚχϡΞϧͷมߋ ϦϑΝϨϯεΛ࡞੒

Slide 63

Slide 63 text

FAQϒϥογϡΞοϓ

Slide 64

Slide 64 text

FAQ

Slide 65

Slide 65 text

FAQ • SDK࣮૷ϚχϡΞϧͱ৘ใ͕ॏෳ • ৘ใ͕ߋ৽ͯ͠ͳ͍ʢϝϯς͸Ӧۀ͕୲౰ʣ • ࣾ֨໰୊

Slide 66

Slide 66 text

FAQ • Ӧۀ͕ϝϯς୲౰ͳͷͰɺ΢έૂ͍͸࡟আ͠ ͯ΋Β͍ɺ੔ཧΛ͓ئ͍ͨ͠ɻ • Ͳ͕͜SDKϚχϡΞϧͱॏෳ͢Δ͔Λ఻͑ɺ ඞཁͳ΋ͷΛߜͬͯ΋Βͬͨɻ

Slide 67

Slide 67 text

·ͱΊ

Slide 68

Slide 68 text

·ͱΊ • SDK͸ݱࡏͷ։ൃ؀ڥʹϚονͨ͠ͱ͜Ζ· Ͱ͜Εͨͱࢥ͏ɻ • ϚχϡΞϧ͸ݟ΍͘͢ɺ୳͠΍͘͢ͳͬͨͱ ࢥ͏ɻ

Slide 69

Slide 69 text

͓ΘΓ