SlideShare a Scribd company logo
@peterdotgames peterheinrich
INTEGRATING AMAZ ON APIs IN UNITY
PETER HEINRICH
D E V E L O P E R E V A N G E L I S T, A M A Z O N
AGENDA
A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G
AD
AGENDA
A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G
AD
AMAZON APIs
C U S TO M E R O B S E S S E D
Start with the customer
and work backwards.
J e f f B e zo s
A P P S TO R E V I S I O N
Our vision is to connect
content creators and
customers through apps,
games, and experiences that
create value and delight.
ANDROID PHONES & TABLETS
FIRE TV & FIRE TV STICK
BLACKBERRYFIRE TABLETS
A P I s
Login with AmazonIn-App Purchasing
Mobile Ads
GameCircle
Amazon Fling AD
Amazon Maps Device Messaging
Amazon Drive
A P I s
In-App Purchasing
Mobile Ads
GameCircle
Amazon Fling AD
Amazon provides
support for
AGENDA
A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G
AD
ACCOUNT SET UP
D E V E L O P E R P O RTA L
D E V E L O P E R P O RTA L
D E V E L O P E R P O RTA L
D E V E L O P E R P O RTA L
D E V E L O P E R P O RTA L http://bit.ly/AppstoreSDK
AGENDA
A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G
AD
MOBILE ADS
AD
M O B I L E A D S
MONETIZATION ACROSS PLATFORMS/ APPSTORES
Multiple ad formats optimised for Fire OS,
Android, and iOS operating systems
Great eCPM – get paid on ad impressions
served instead of clicks on ads
Highly relevant mobile optimized ads from
Amazon and high quality brands
D E TA I L S
AD
M O B I L E A D S
• Static Banners
• Rich Media Banners
• Static Interstitials
• Modeless Interstitials
• Rich Media Interstitials
(includes click-to-play video)
ADDING THE UNITY PLUGINAD
ADDING THE UNITY PLUGINAD
ADDING THE UNITY PLUGINAD
D E V E L O P E R P O RTA L
D E V E L O P E R P O RTA L
D E V E L O P E R P O RTA L
using com.amazon.mas.cpt.ads;
// Obtain object used to interact with the plugin
IAmazonMobileAds mobileAds = AmazonMobileAdsImpl.Instance;
public string androidKey = "d914c248d27248d19cdd26039bf5846d";
public string iosKey = "9cdd26039bf5846dd914c248d27248d1";
// Construct object passed to sync operation as input
ApplicationKey key = new ApplicationKey();
// Use Android app key for Android apps and iOS
// app key for iOS apps
#if UNITY_ANDROID
key.StringValue = androidKey;
#elif UNITY_IPHONE
key.StringValue = iosKey;
#endif
// Call method, passing in required input structure
// This method does not return a response
mobileAds.SetApplicationKey( key );
S E T T H E A P P L I C AT I O N K E Y ( S )
using com.amazon.mas.cpt.ads;
public void EnableTesting() {
// Obtain object used to interact with the plugin
IAmazonMobileAds mobileAds = AmazonMobileAdsImpl.Instance;
// Construct object passed to sync operation as input
ShouldEnable enable = new ShouldEnable();
// Set input value
enable.BooleanValue = true;
// Call method, passing in required input structure
// This method does not return a response
mobileAds.EnableTesting( enable );
mobileAds.EnableLogging( enable );
}
E N A B L E T E S T I N G A N D L O G G I N G
<manifest ...>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
...
<application ...>
<activity android:name="com.amazon.device.ads.AdActivity"
android:configChanges="keyboardHidden|orientation|screenSize"/>
...
</application>
</manifest>
AndroidManifest.xml
using com.amazon.mas.cpt.ads;
public void DisplayFloatingAd() {
// Obtain object used to interact with the plugin
IAmazonMobileAds mobileAds = AmazonMobileAdsImpl.Instance;
// Configure the placement of the ad
Placement placement = new Placement();
placement.Dock = Dock.TOP;
placement.HorizontalAlign = HorizontalAlign.CENTER;
placement.AdFit = AdFit.FIT_AD_SIZE;
// This method returns an Ad object, which you must save and keep track of
Ad response = mobileAds.CreateFloatingBannerAd( placement );
// Now that the ad has been created, load it and show it on the screen
LoadingStarted loadResp = mobileAds.LoadAndShowFloatingBannerAd( response );
}
C R E AT E A N D D I S P L AY A T E S T A D
Workshop: Integrating Amazon APIs in Unity
using com.amazon.mas.cpt.ads;
// Define event handlers
private void HandleAdLoaded( Ad args ) {
string adType = args.AdType.ToString();
long identifier = args.Identifier;
// Do something. . .
}
private void HandleAdFailedToLoad( Ad args ) {
string adType = args.AdType.ToString();
long identifier = args.Identifier;
// Do something. . .
}
// Register for the events
mobileAds.AddAdLoadedListener( HandleAdLoaded );
mobileAds.AddAdFailedToLoadListener( HandleAdFailedToLoad );
R E G I S T E R I N G F O R E V E N T S
TO I N I T I AT E A M E T H O D C A L L
Obtain the object used to interact with the
plugin.
S U M M A RY
If needed, construct the object used to pass
input to the operation.
For asynchronous operations, define a callback
function that is invoked when a response is
ready.
Call the operation, passing in any required
input and/or callback function as arguments.
AD
IAmazonMobileAds mobileAds =
AmazonMobileAdsImpl.Instance;
Placement placement = new Placement();
placement.Dock = Dock.TOP;
private void HandleAdLoaded( Ad args ) {
// Do something. . .
}
mobileAds.SetApplicationKey( key );
Example:
AGENDA
A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G
AD
AMAZON FLING
A M A Z O N F L I N G
BUILD RICH MULTI-SCREEN EXPERIENCES
Cross platform toolkit that enables you to
build rich multi-screen experiences for Fire TV
Allows sending video, audio and images from
iOS, Android, or Fire OS
Leverage two-way communication between
Amazon Fire TV and mobile apps to create
engaging second screen experiences
D E TA I L S
using com.amazon.whisperplay.fling.cpt.media.controller;
using com.amazon.whisperplay.fling.cpt.media.controller.json;
void Start () {
deviceList = new SortedList<string, Player>();
if (flingService == null) {
flingService = AmazonFlingServiceImpl.Instance;
OnResume();
}
// Register event handlers
flingService.AddPlayerDiscoveredListener( PlayerDiscovered );
flingService.AddPlayerLostListener( PlayerLost );
flingService.AddDiscoveryFailureListener( DiscoveryFailure );
flingService.AddOnStatusChangeListener( OnStatusChange );
// Load resources to display catalog of available media. . .
}
I N I T I A L I Z E T H E S E RV I C E
private void PlayerDiscovered( Player args ) {
deviceList.Add( args.PlayerId, args );
if( previousPlayer != null && args.PlayerId == previousPlayer.PlayerId ) {
SetDevice( args );
}
if( showDeviceMenu ) {
CreatePickerList();
}
}
private void PlayerLost( Player args ) {
deviceList.Remove(args.PlayerId );
if( showDeviceMenu ) {
CreatePickerList();
}
}
E V E N T H A N D L E R S
A D D I T I O N A L D E P L O Y M E N T S T E P S
i O S A N D R O I D
1. In Xcode, select your Xcode project root.
2. Select the target Unity-iPhone.
3. Click the Build Phases tab.
4. Open the Link Binary with Libraries foldout.
5. Cluck the + at the bottom of the this foldout.
6. Add all the frameworks and libraries required by
the SDK:
1. AmazonFling.framework
2. Bolts.framework
3. AdSupport.framework
4. Security.framework
5. Libc++.dylib
7. Follow iOS SDK’s specific guidelines for importing
dependencies.
1. Add these android.permission values to your
manifest:
On Fire OS & Android:
INTERNET
ACCESS_WIFI_STATE
ACCESS_NETWORK_STATE
On Android only:
CHANGE_WIFI_MULTICAST_STATE
2. On Fire OS only, add this line to the application
section of Plugins/Android/AndroidManifest.xml
(and remove the Plugins/Android/WhisperPlay.jar):
<uses-library android:name=
"com.amazon.whisperplay.contracts" />
http://bit.ly/FlingSteps
WHERE DO WE GO
FROM HERE?
W H E R E D O W E G O F R O M H E R E ?
N E X T S T E P S
CREATE YOUR
DEVELOPER ACCOUNT PUBLISH!BUILD YOUR APP
REVIEW DEV
PORTAL RESOURCES
NEW
developer.amazon.com/public
Peter Heinrich
@peterdotgames
@AmazonAppDev
heinrich@amazon.co.uk
developer.amazon.com/appstore
THANK YOU!
bit.ly/AmazonSummitFeedback

More Related Content

Viewers also liked (17)

PDF
Actionable Analytics: Using Better Data Better
Amazon Appstore Developers
 
PDF
What the Top 50 Apps Do with IAP That the Rest of Us Don't
Amazon Appstore Developers
 
PDF
Is This Really All There Is? More Ways to Monetize - Mike Hines
Amazon Appstore Developers
 
PDF
Is This All There Is? What's New in Monetization
Amazon Appstore Developers
 
PDF
Building New Experiences on Amazon Fire TV - Mario Viviani
Amazon Appstore Developers
 
PDF
Reach More Players: Smart Design for Streaming Media Devices
Amazon Appstore Developers
 
PPTX
5 Best Practices of Top-Earning Mobile Apps and Games - Mario Viviani
Amazon Appstore Developers
 
PDF
Working Backward from Amazon Customers: Audience Marketing Strategies - Lau...
Amazon Appstore Developers
 
PDF
Keynote - What's New in Amazon Appstore 2016
Amazon Appstore Developers
 
PPTX
How To: Bringing Media Channels to Amazon Fire TV
Amazon Appstore Developers
 
PDF
Developing Android Apps for TV in Minutes with Amazon Fire App Builder
Amazon Appstore Developers
 
PDF
Amazon Lab126
Amazon Appstore Developers
 
PDF
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...
Amazon Appstore Developers
 
PPTX
Metrics on the Money: The Art & Science of Change Measurement
Centric Consulting
 
PDF
Finally, A Voice for the Enterprise!
Centric Consulting
 
PDF
Voice interfaces
Sam Machin
 
PDF
Amazon Alexa Voice Interfaces Meetup Berlin August 2016
Tilmann Böhme
 
Actionable Analytics: Using Better Data Better
Amazon Appstore Developers
 
What the Top 50 Apps Do with IAP That the Rest of Us Don't
Amazon Appstore Developers
 
Is This Really All There Is? More Ways to Monetize - Mike Hines
Amazon Appstore Developers
 
Is This All There Is? What's New in Monetization
Amazon Appstore Developers
 
Building New Experiences on Amazon Fire TV - Mario Viviani
Amazon Appstore Developers
 
Reach More Players: Smart Design for Streaming Media Devices
Amazon Appstore Developers
 
5 Best Practices of Top-Earning Mobile Apps and Games - Mario Viviani
Amazon Appstore Developers
 
Working Backward from Amazon Customers: Audience Marketing Strategies - Lau...
Amazon Appstore Developers
 
Keynote - What's New in Amazon Appstore 2016
Amazon Appstore Developers
 
How To: Bringing Media Channels to Amazon Fire TV
Amazon Appstore Developers
 
Developing Android Apps for TV in Minutes with Amazon Fire App Builder
Amazon Appstore Developers
 
Creating Rich Multi-Screen Experiences on Android with Amazon Fling - Mario V...
Amazon Appstore Developers
 
Metrics on the Money: The Art & Science of Change Measurement
Centric Consulting
 
Finally, A Voice for the Enterprise!
Centric Consulting
 
Voice interfaces
Sam Machin
 
Amazon Alexa Voice Interfaces Meetup Berlin August 2016
Tilmann Böhme
 

Similar to Workshop: Integrating Amazon APIs in Unity (20)

PDF
Scale up your apps and games building new experiences on amazon fire tv
Amazon Appstore Developers
 
PDF
Workshop: Amazon developer ecosystem - DroidCon Paris2014
Paris Android User Group
 
PPTX
An Overview of the Amazon Devices and Services for Mobile Developers
Amazon Appstore Developers
 
PDF
Developing Media Streaming Android Apps the Easy Way with Fire App Builder - ...
Amazon Appstore Developers
 
PDF
Google admob mediation tutorial
Indrajit Paliwal
 
PDF
Google admob mediation tutorial
Rakesh Singh Parihar
 
DOCX
PICS QUIZ - INTEGRATION
Sebastian Restrepo
 
PPT
Extending Appcelerator Titanium Mobile through Native Modules
omorandi
 
PPTX
Mobile Game Development using Adobe Flash
chall3ng3r
 
PDF
Going Mobile - Flash Gaming Summit 2012
Nate Beck
 
PPTX
Bam amor mobile development tools
Bam Amor
 
PPTX
Introduction to MonoTouch
Jonas Follesø
 
PPTX
Bam windows phone 7 for informatics
Bam Amor
 
PPTX
Unity and Azure Mobile Services using Prime31 plugin
David Douglas
 
PPTX
Mobile App Development - Coddle 1.pptx
MarkThomas316888
 
PPTX
Windows phone
Rishabha Garg
 
PPTX
Building apps for multiple devices
Terry Ryan
 
PPTX
MOBILE APPLICATIONS DEVELOPMENT AND SERVICES.pptx
muthulakshmi cse
 
PPTX
Going Mobile by Nate Beck
mochimedia
 
PDF
Making Telecoms the Essential Spice of Every Business Ecosystem: The Slow, Pa...
Alan Quayle
 
Scale up your apps and games building new experiences on amazon fire tv
Amazon Appstore Developers
 
Workshop: Amazon developer ecosystem - DroidCon Paris2014
Paris Android User Group
 
An Overview of the Amazon Devices and Services for Mobile Developers
Amazon Appstore Developers
 
Developing Media Streaming Android Apps the Easy Way with Fire App Builder - ...
Amazon Appstore Developers
 
Google admob mediation tutorial
Indrajit Paliwal
 
Google admob mediation tutorial
Rakesh Singh Parihar
 
PICS QUIZ - INTEGRATION
Sebastian Restrepo
 
Extending Appcelerator Titanium Mobile through Native Modules
omorandi
 
Mobile Game Development using Adobe Flash
chall3ng3r
 
Going Mobile - Flash Gaming Summit 2012
Nate Beck
 
Bam amor mobile development tools
Bam Amor
 
Introduction to MonoTouch
Jonas Follesø
 
Bam windows phone 7 for informatics
Bam Amor
 
Unity and Azure Mobile Services using Prime31 plugin
David Douglas
 
Mobile App Development - Coddle 1.pptx
MarkThomas316888
 
Windows phone
Rishabha Garg
 
Building apps for multiple devices
Terry Ryan
 
MOBILE APPLICATIONS DEVELOPMENT AND SERVICES.pptx
muthulakshmi cse
 
Going Mobile by Nate Beck
mochimedia
 
Making Telecoms the Essential Spice of Every Business Ecosystem: The Slow, Pa...
Alan Quayle
 
Ad

More from Amazon Appstore Developers (11)

PDF
Bring Your Content Forward on Amazon Fire TV: Creating TV Apps in the Age of ...
Amazon Appstore Developers
 
PDF
Designing Apps in the Age of Media Streaming: Optimise Your Content for TV
Amazon Appstore Developers
 
PDF
Bring Your Content Forward on Amazon Fire TV
Amazon Appstore Developers
 
PDF
IMPLEMENTING VOICE CONTROL WITH THE ANDROID MEDIA SESSION API ON AMAZON FIRE ...
Amazon Appstore Developers
 
PDF
Why and How to Add In-App Purchasing and Subscriptions to your Apps - Mario V...
Amazon Appstore Developers
 
PDF
Working Backward from Amazon Customers - Audience Marketing Strategies for Ap...
Amazon Appstore Developers
 
PDF
In-App Purchase Like a Pro: Best Practices from the Top 50 Apps - Mario Viviani
Amazon Appstore Developers
 
PDF
Introduction to the Amazon Appstore
Amazon Appstore Developers
 
PDF
Introduction to App Stores
Amazon Appstore Developers
 
PDF
Submitting Apps and Games to the Amazon Appstore
Amazon Appstore Developers
 
PPTX
How To Evolve Players Into Fans
Amazon Appstore Developers
 
Bring Your Content Forward on Amazon Fire TV: Creating TV Apps in the Age of ...
Amazon Appstore Developers
 
Designing Apps in the Age of Media Streaming: Optimise Your Content for TV
Amazon Appstore Developers
 
Bring Your Content Forward on Amazon Fire TV
Amazon Appstore Developers
 
IMPLEMENTING VOICE CONTROL WITH THE ANDROID MEDIA SESSION API ON AMAZON FIRE ...
Amazon Appstore Developers
 
Why and How to Add In-App Purchasing and Subscriptions to your Apps - Mario V...
Amazon Appstore Developers
 
Working Backward from Amazon Customers - Audience Marketing Strategies for Ap...
Amazon Appstore Developers
 
In-App Purchase Like a Pro: Best Practices from the Top 50 Apps - Mario Viviani
Amazon Appstore Developers
 
Introduction to the Amazon Appstore
Amazon Appstore Developers
 
Introduction to App Stores
Amazon Appstore Developers
 
Submitting Apps and Games to the Amazon Appstore
Amazon Appstore Developers
 
How To Evolve Players Into Fans
Amazon Appstore Developers
 
Ad

Workshop: Integrating Amazon APIs in Unity

  • 1. @peterdotgames peterheinrich INTEGRATING AMAZ ON APIs IN UNITY PETER HEINRICH D E V E L O P E R E V A N G E L I S T, A M A Z O N
  • 2. AGENDA A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G AD
  • 3. AGENDA A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G AD
  • 5. C U S TO M E R O B S E S S E D Start with the customer and work backwards. J e f f B e zo s
  • 6. A P P S TO R E V I S I O N Our vision is to connect content creators and customers through apps, games, and experiences that create value and delight.
  • 7. ANDROID PHONES & TABLETS FIRE TV & FIRE TV STICK BLACKBERRYFIRE TABLETS
  • 8. A P I s Login with AmazonIn-App Purchasing Mobile Ads GameCircle Amazon Fling AD Amazon Maps Device Messaging Amazon Drive
  • 9. A P I s In-App Purchasing Mobile Ads GameCircle Amazon Fling AD Amazon provides support for
  • 10. AGENDA A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G AD
  • 12. D E V E L O P E R P O RTA L
  • 13. D E V E L O P E R P O RTA L
  • 14. D E V E L O P E R P O RTA L
  • 15. D E V E L O P E R P O RTA L
  • 16. D E V E L O P E R P O RTA L http://bit.ly/AppstoreSDK
  • 17. AGENDA A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G AD
  • 19. M O B I L E A D S MONETIZATION ACROSS PLATFORMS/ APPSTORES Multiple ad formats optimised for Fire OS, Android, and iOS operating systems Great eCPM – get paid on ad impressions served instead of clicks on ads Highly relevant mobile optimized ads from Amazon and high quality brands D E TA I L S AD
  • 20. M O B I L E A D S • Static Banners • Rich Media Banners • Static Interstitials • Modeless Interstitials • Rich Media Interstitials (includes click-to-play video)
  • 21. ADDING THE UNITY PLUGINAD
  • 22. ADDING THE UNITY PLUGINAD
  • 23. ADDING THE UNITY PLUGINAD
  • 24. D E V E L O P E R P O RTA L
  • 25. D E V E L O P E R P O RTA L
  • 26. D E V E L O P E R P O RTA L
  • 27. using com.amazon.mas.cpt.ads; // Obtain object used to interact with the plugin IAmazonMobileAds mobileAds = AmazonMobileAdsImpl.Instance; public string androidKey = "d914c248d27248d19cdd26039bf5846d"; public string iosKey = "9cdd26039bf5846dd914c248d27248d1"; // Construct object passed to sync operation as input ApplicationKey key = new ApplicationKey(); // Use Android app key for Android apps and iOS // app key for iOS apps #if UNITY_ANDROID key.StringValue = androidKey; #elif UNITY_IPHONE key.StringValue = iosKey; #endif // Call method, passing in required input structure // This method does not return a response mobileAds.SetApplicationKey( key ); S E T T H E A P P L I C AT I O N K E Y ( S )
  • 28. using com.amazon.mas.cpt.ads; public void EnableTesting() { // Obtain object used to interact with the plugin IAmazonMobileAds mobileAds = AmazonMobileAdsImpl.Instance; // Construct object passed to sync operation as input ShouldEnable enable = new ShouldEnable(); // Set input value enable.BooleanValue = true; // Call method, passing in required input structure // This method does not return a response mobileAds.EnableTesting( enable ); mobileAds.EnableLogging( enable ); } E N A B L E T E S T I N G A N D L O G G I N G
  • 29. <manifest ...> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> ... <application ...> <activity android:name="com.amazon.device.ads.AdActivity" android:configChanges="keyboardHidden|orientation|screenSize"/> ... </application> </manifest> AndroidManifest.xml
  • 30. using com.amazon.mas.cpt.ads; public void DisplayFloatingAd() { // Obtain object used to interact with the plugin IAmazonMobileAds mobileAds = AmazonMobileAdsImpl.Instance; // Configure the placement of the ad Placement placement = new Placement(); placement.Dock = Dock.TOP; placement.HorizontalAlign = HorizontalAlign.CENTER; placement.AdFit = AdFit.FIT_AD_SIZE; // This method returns an Ad object, which you must save and keep track of Ad response = mobileAds.CreateFloatingBannerAd( placement ); // Now that the ad has been created, load it and show it on the screen LoadingStarted loadResp = mobileAds.LoadAndShowFloatingBannerAd( response ); } C R E AT E A N D D I S P L AY A T E S T A D
  • 32. using com.amazon.mas.cpt.ads; // Define event handlers private void HandleAdLoaded( Ad args ) { string adType = args.AdType.ToString(); long identifier = args.Identifier; // Do something. . . } private void HandleAdFailedToLoad( Ad args ) { string adType = args.AdType.ToString(); long identifier = args.Identifier; // Do something. . . } // Register for the events mobileAds.AddAdLoadedListener( HandleAdLoaded ); mobileAds.AddAdFailedToLoadListener( HandleAdFailedToLoad ); R E G I S T E R I N G F O R E V E N T S
  • 33. TO I N I T I AT E A M E T H O D C A L L Obtain the object used to interact with the plugin. S U M M A RY If needed, construct the object used to pass input to the operation. For asynchronous operations, define a callback function that is invoked when a response is ready. Call the operation, passing in any required input and/or callback function as arguments. AD IAmazonMobileAds mobileAds = AmazonMobileAdsImpl.Instance; Placement placement = new Placement(); placement.Dock = Dock.TOP; private void HandleAdLoaded( Ad args ) { // Do something. . . } mobileAds.SetApplicationKey( key ); Example:
  • 34. AGENDA A M A Z O N A P I s A C C O U N T S E T U P M O B I L E A D S A M A Z O N F L I N G AD
  • 36. A M A Z O N F L I N G BUILD RICH MULTI-SCREEN EXPERIENCES Cross platform toolkit that enables you to build rich multi-screen experiences for Fire TV Allows sending video, audio and images from iOS, Android, or Fire OS Leverage two-way communication between Amazon Fire TV and mobile apps to create engaging second screen experiences D E TA I L S
  • 37. using com.amazon.whisperplay.fling.cpt.media.controller; using com.amazon.whisperplay.fling.cpt.media.controller.json; void Start () { deviceList = new SortedList<string, Player>(); if (flingService == null) { flingService = AmazonFlingServiceImpl.Instance; OnResume(); } // Register event handlers flingService.AddPlayerDiscoveredListener( PlayerDiscovered ); flingService.AddPlayerLostListener( PlayerLost ); flingService.AddDiscoveryFailureListener( DiscoveryFailure ); flingService.AddOnStatusChangeListener( OnStatusChange ); // Load resources to display catalog of available media. . . } I N I T I A L I Z E T H E S E RV I C E
  • 38. private void PlayerDiscovered( Player args ) { deviceList.Add( args.PlayerId, args ); if( previousPlayer != null && args.PlayerId == previousPlayer.PlayerId ) { SetDevice( args ); } if( showDeviceMenu ) { CreatePickerList(); } } private void PlayerLost( Player args ) { deviceList.Remove(args.PlayerId ); if( showDeviceMenu ) { CreatePickerList(); } } E V E N T H A N D L E R S
  • 39. A D D I T I O N A L D E P L O Y M E N T S T E P S i O S A N D R O I D 1. In Xcode, select your Xcode project root. 2. Select the target Unity-iPhone. 3. Click the Build Phases tab. 4. Open the Link Binary with Libraries foldout. 5. Cluck the + at the bottom of the this foldout. 6. Add all the frameworks and libraries required by the SDK: 1. AmazonFling.framework 2. Bolts.framework 3. AdSupport.framework 4. Security.framework 5. Libc++.dylib 7. Follow iOS SDK’s specific guidelines for importing dependencies. 1. Add these android.permission values to your manifest: On Fire OS & Android: INTERNET ACCESS_WIFI_STATE ACCESS_NETWORK_STATE On Android only: CHANGE_WIFI_MULTICAST_STATE 2. On Fire OS only, add this line to the application section of Plugins/Android/AndroidManifest.xml (and remove the Plugins/Android/WhisperPlay.jar): <uses-library android:name= "com.amazon.whisperplay.contracts" /> http://bit.ly/FlingSteps
  • 40. WHERE DO WE GO FROM HERE?
  • 41. W H E R E D O W E G O F R O M H E R E ? N E X T S T E P S CREATE YOUR DEVELOPER ACCOUNT PUBLISH!BUILD YOUR APP REVIEW DEV PORTAL RESOURCES NEW developer.amazon.com/public