SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Newsstand
  Kaz Yoshikawa
Why Newsstand?

•   Contents can be delivered to devices while sleeping
    •   background downloading
•   Good for subscription type business model
    •   Magazines, Newspaper, Free papers ...
How Newsstand Work?
④ Launch with                                                    Your Server
Background mode                                     ① Launch Time
                                                    Device Token, etc.
                                           ⑤ Download Contents

                                                 Contents
                                                                         SSL
                                     ② When New Issue is Ready           Certificate
                                                       Device Token
                ⑥ Enjoy Reading Contents

       ③ Push Notification
                                                             Apple’s APNS
Requirements (Vender)
•   Server facility
    •   Hosting contents for downloading:
        •   Capable of simultaneous download requests
    •   Push Notifications
        •   Server side programming: i.e. Apache+MySQL+PHP
        •   SSL Certificate *
Provisioning Portal
       Paper Work
New App ID
Enable Push Notification
Register SSL Certificate
Provisioning Profiles
•   Push Notification won’t work on Wildcard provisioning
iTunes Connect
   Another Paper Work
Add New App from ITC


•   In-App-Purchase can only be
    configured from iTunesConnect
•
In-App Purchases
In-App Purchases




               Auto-Renewable

               Free Subscription
Add Duration and Pricing


                    Duration

                    Sale or not
                    Price Tier
Adding a Language
In-App Purchases
Shared Secret
Enabling Newsstand
Issues
Issue Added
ATOM Feed
•   Apple’s server checks your new issues time to time to
    update iTunesConnect.
Xcode
Info plist
Register Remote Notification
  - (BOOL)application:(UIApplication *)application
  didFinishLaunchingWithOptions:(NSDictionary *)options
{
! // ...
! UIRemoteNotificationType type =
           UIRemoteNotificationTypeBadge |
! ! ! ! UIRemoteNotificationTypeSound |
! ! ! ! UIRemoteNotificationTypeAlert |
           UIRemoteNotificationTypeNewsstandContentAvailability;
! [[UIApplication sharedApplication]
          registerForRemoteNotificationTypes:type];
}
Newsstand Notification
•   Receive remote notification only once a day
    •   You cannot push two contents a day
•   You can push regular push notifications multiple time
•   For debuging:
    [[NSUserDefaults standardUserDefaults] setValue:@YES
        forKey:@"NKDontThrottleNewsstandContentNotifications"];
Send Token To Your Server
        with APS Environment
- (void)application:(UIApplication *)application
   didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)token
{
#if DEBUG
! NSString *aps_environment = @"development";      Why?
#else
! NSString *aps_environment = @"production";
#endif
! // send token to your server with other properties aps_environment
}
Different Token:
             Development/Production

       Debug                            Release

                                                                 APNS
                                                  production
                                                                  Sandbox
                     development


    app_id           token       environment

com.electricwoo
                  0x123...af30   development    Your
ds.yourmagazine
com.electricwoo
                  0x5c6...78c1    production   Server            APNS
ds.yourmagazine                                                Production
Downloading New Issue
                                                       Your Server
APNS     ① Push Notification      ② Query Issues

{                              Issue name, Published date, Download URL
  "aps":{
! "content-available":1,
        },                      ③ Download new Issue
  ...
}
          Payload
                                            ④ Unzip* and move
    ⑤ Replace Newsstand Icon


                                                               * optional
Downloading New Issue
- (void)downloadContentName:(NSString *)name
        URL:(NSURL *)URL date:(NSDate *)date
{
    NKLibrary *lib = [NKLibrary sharedLibrary];
    NKIssue *issue = [lib issueWithName:name];
    if (!issue) {
        issue = [lib addIssueWithName:name date:date];
        NKAssetDownload *download = [issue addAssetWithRequest:
            [NSURLRequest requestWithURL:URL]];
        [download downloadWithDelegate:self];
    }
}

- (void)connectionDidFinishDownloading:(NSURLConnection *)connection
    destinationURL:(NSURL *)destinationURL
{
!   NSIssue *issue = connection.newsstandAssetDownload.issue;
    NSString *contentPath = issue.contentURL.path;
    // unzip destinationURL to contentPath
}
Restore Downloads
                at Launch Time
!
                                                       Don’t forget


  NKLibrary *library = [NKLibrary sharedLibrary];
! for (NKAssetDownload *download in library.downloadingAssets) {
! ! [download downloadWithDelegate:self];
! }
Making a list of Issues
NKLibrary *lib = [NKLibrary sharedLibrary];
NSArray *issues = [lib issues];




                                    Build a Great
                                     Bookshelf
In App Purchase
Auto-renewable Subscription
•   Newsstand App requires at least one Auto-renewable
    subscription or free subscription
•   Auto-renewable durations are: 7d, 1m, 2m, 3m, 6m, 1y
•   StoreKit won’t let app know duration from product
    identifier
    •   Need to query to your server or hard-coded
Restore Problem
•   What if Someone purchased auto-renewable
    subscriptions in-and-out few times
•   Purchased records can be retrieved by restore operation
•   But it can be cancelled, and StoreKit wouldn’t tell me...
•   Needs to ask to Apple’s server to verify those purchases



Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Verifying Receipt
- (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue
*)queue
! for (SKPaymentTransaction *transaction in queue.transactions) {
! ! NSString *identifier = transaction.payment.productIdentifier;
! ! switch (transaction.transactionState) {
! ! case SKPaymentTransactionStatePurchasing: // ...
! ! case SKPaymentTransactionStateFailed: // ...

!   !   case SKPaymentTransactionStatePurchased:
!   !   case SKPaymentTransactionStateRestored:
!   !   ! [self verifyTransactionReceipt:transaction];
!   !   ! break;
!   !   }
!   }
}

- (void)verifyTransactionReceipt:(SKPaymentTransaction *)transaction
{
   ... do your stuff ...
   [queue finishTransaction:transaction];
}
DEBUG
                   Verifying Receipts
                                                                               App Store
                                                                                 Production
         {
              "receipt-data" : "(receipt bytes here)",
              "sandbox"      : 1
         }




         {
           "status" : 0,
           "receipt" : ,
           "latest_receipt" : ...      {
   0       "latest_receipt_info" : ...   "receipt-data" : "(receipt bytes here)",
         }                               "password"     : "(shared secret bytes here)"
  OK                                   }

                                                                                          Sandbox
                                             {
                                                 "status" : 0,
                                                                                   App Store
Your Server                                      "receipt" : { (receipt here) },
                                                 "latest_receipt" : "(base-64 encoded receipt here
                                                 "latest_receipt_info" : { (latest receipt info here
                                             }
PRODUCTION
                   Verifying Receipts
                                                                                App Store
                                                                                  Production
                                                         {
          {
                                                             "receipt-data" : "(receipt bytes here)",
              "receipt-data" : "(receipt bytes here)",
                                                             "password"     : "(shared secret bytes he
          }
                                                         }


                                                         {
                                                             "status" : 21006,
          {                                                  "receipt" : { (receipt here) },
              "status" : 21006,                              "latest_receipt" : "(base-64 encoded re
              "receipt" : ,                                  "latest_receipt_info" : { (latest receip
              "latest_receipt" : ...                     }
21006         "latest_receipt_info" : ...
          }
expired
                                                                                            Sandbox
                                                                                     App Store
Your Server
Auto renewable subscription
     recurring duration
           Production         Sandbox
             1 week           3 minutes
            1 month           5 minutes
            2 months         10 minutes
            3 months         15 minutes
            6 months         30 minutes
             1 year            1 hour

    Automatically expires in 6th time recurring
"receipt" :{
                        Not Expired                             "receipt":{
                                                                                         Expired
      "unique_identifier":"44f9ec48b952a....34e12c61c9c4f",            "unique_identifier":"44f9ec48b952a....34e12c61c9c4f",
      "original_transaction_id":"1000000055744550",                   "original_transaction_id":"1000000055744550",
      "expires_date":"1348131173000",                                 "expires_date":"1347344399000",
      "transaction_id":"1000000056135747",                            "transaction_id":"1000000055932398",
      "quantity":"1",                                                 "quantity":"1",
      "product_id":"yourmagazine.1mo",                                "product_id":"yourmagazine.1mo",
      "original_purchase_date_ms":"1347343199000",                    "original_purchase_date_ms":"1347343199000",
      "bid":"com.electricwoods.newsstand",                            "bid":"com.electricwoods.newsstand",
      "bvrs":"1.0",                                                   "bvrs":"1.0",
      "expires_date_formatted":"2012-09-20 08:52:53 Etc/GMT",         "expires_date_formatted":"2012-09-11 06:19:59 Etc/GMT",
      "purchase_date":"2012-09-20 08:47:53 Etc/GMT",                  "purchase_date":"2012-09-11 06:14:59 Etc/GMT",
      "purchase_date_ms":"1348130873000",                             "purchase_date_ms":"1347344099000",
      "original_purchase_date":"2012-09-11 05:59:59 Etc/GMT",         "original_purchase_date":"2012-09-11 05:59:59 Etc/GMT",
      "item_id":"558725164",                                          "item_id":"558725164"
};                                                              },
“status”: 0                                                     "status":21006
Wrap Up
These are what you get

           Newsstand



                       Push Notification

 In App
Purchase
                                          UIKit
This is what you gonna build
kyoshikawa@electricwoods.com




              Thank you
                    Electricwoods LLC

Más contenido relacionado

Destacado

Programming Complex Algorithm in Swift
Programming Complex Algorithm in SwiftProgramming Complex Algorithm in Swift
Programming Complex Algorithm in SwiftKaz Yoshikawa
 
Idioms in swift 2016 05c
Idioms in swift 2016 05cIdioms in swift 2016 05c
Idioms in swift 2016 05cKaz Yoshikawa
 
Programming Language Swift Overview
Programming Language Swift OverviewProgramming Language Swift Overview
Programming Language Swift OverviewKaz Yoshikawa
 
Extracting text from PDF (iOS)
Extracting text from PDF (iOS)Extracting text from PDF (iOS)
Extracting text from PDF (iOS)Kaz Yoshikawa
 
TizenLog.pl: In App Purchase
TizenLog.pl: In App PurchaseTizenLog.pl: In App Purchase
TizenLog.pl: In App PurchaseoMatej
 
The Power Of In-App Purchases
The Power Of In-App PurchasesThe Power Of In-App Purchases
The Power Of In-App PurchasesNoel Llopis
 
IAP introduce@myBook
IAP introduce@myBook IAP introduce@myBook
IAP introduce@myBook Jason Huang
 
Basic shooting schedule
Basic shooting scheduleBasic shooting schedule
Basic shooting schedule11187AJ
 
Serious Games + Learning Science = Win: How to Teach Product Knowledge, Polic...
Serious Games + Learning Science = Win: How to Teach Product Knowledge, Polic...Serious Games + Learning Science = Win: How to Teach Product Knowledge, Polic...
Serious Games + Learning Science = Win: How to Teach Product Knowledge, Polic...Bottom-Line Performance
 
Treball religió
Treball religióTreball religió
Treball religióBuscarons
 
нескучная презентация
нескучная презентациянескучная презентация
нескучная презентацияTatyanaSannikova
 
365Hangers_Lifestyle
365Hangers_Lifestyle365Hangers_Lifestyle
365Hangers_Lifestyle365Hangers
 
Presentació
PresentacióPresentació
PresentacióESO1
 
Основная позиция пальцев на клавиатуре
Основная позиция пальцев на клавиатуреОсновная позиция пальцев на клавиатуре
Основная позиция пальцев на клавиатуремарина маслова
 
Aplazamiento de sanción en casos de it si la empresa
Aplazamiento de sanción en casos de it si la empresaAplazamiento de sanción en casos de it si la empresa
Aplazamiento de sanción en casos de it si la empresaR R.
 
Music questionaire
Music questionaireMusic questionaire
Music questionairecat663
 

Destacado (20)

Programming Complex Algorithm in Swift
Programming Complex Algorithm in SwiftProgramming Complex Algorithm in Swift
Programming Complex Algorithm in Swift
 
Idioms in swift 2016 05c
Idioms in swift 2016 05cIdioms in swift 2016 05c
Idioms in swift 2016 05c
 
Programming Language Swift Overview
Programming Language Swift OverviewProgramming Language Swift Overview
Programming Language Swift Overview
 
Extracting text from PDF (iOS)
Extracting text from PDF (iOS)Extracting text from PDF (iOS)
Extracting text from PDF (iOS)
 
TizenLog.pl: In App Purchase
TizenLog.pl: In App PurchaseTizenLog.pl: In App Purchase
TizenLog.pl: In App Purchase
 
The Power Of In-App Purchases
The Power Of In-App PurchasesThe Power Of In-App Purchases
The Power Of In-App Purchases
 
In-App Purchase
In-App PurchaseIn-App Purchase
In-App Purchase
 
IAP introduce@myBook
IAP introduce@myBook IAP introduce@myBook
IAP introduce@myBook
 
O universo
O universoO universo
O universo
 
Basic shooting schedule
Basic shooting scheduleBasic shooting schedule
Basic shooting schedule
 
Serious Games + Learning Science = Win: How to Teach Product Knowledge, Polic...
Serious Games + Learning Science = Win: How to Teach Product Knowledge, Polic...Serious Games + Learning Science = Win: How to Teach Product Knowledge, Polic...
Serious Games + Learning Science = Win: How to Teach Product Knowledge, Polic...
 
Treball religió
Treball religióTreball religió
Treball religió
 
Trabajo taller
Trabajo tallerTrabajo taller
Trabajo taller
 
профи звук
профи звукпрофи звук
профи звук
 
нескучная презентация
нескучная презентациянескучная презентация
нескучная презентация
 
365Hangers_Lifestyle
365Hangers_Lifestyle365Hangers_Lifestyle
365Hangers_Lifestyle
 
Presentació
PresentacióPresentació
Presentació
 
Основная позиция пальцев на клавиатуре
Основная позиция пальцев на клавиатуреОсновная позиция пальцев на клавиатуре
Основная позиция пальцев на клавиатуре
 
Aplazamiento de sanción en casos de it si la empresa
Aplazamiento de sanción en casos de it si la empresaAplazamiento de sanción en casos de it si la empresa
Aplazamiento de sanción en casos de it si la empresa
 
Music questionaire
Music questionaireMusic questionaire
Music questionaire
 

Similar a Newsstand

(ARC401) Cloud First: New Architecture for New Infrastructure
(ARC401) Cloud First: New Architecture for New Infrastructure(ARC401) Cloud First: New Architecture for New Infrastructure
(ARC401) Cloud First: New Architecture for New InfrastructureAmazon Web Services
 
How to build a server and a iPhone client application using the Apple Push No...
How to build a server and a iPhone client application using the Apple Push No...How to build a server and a iPhone client application using the Apple Push No...
How to build a server and a iPhone client application using the Apple Push No...Shu Masuda
 
DevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursDevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursAmazon Web Services
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleService Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleIsaac Christoffersen
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivAmazon Web Services
 
Scale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricScale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricChris Dufour
 
Cloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFECloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFEPrabath Siriwardena
 
Orion Context Broker
Orion Context Broker Orion Context Broker
Orion Context Broker TIDChile
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without InterferenceTony Tam
 
vpn router Mikrotik
vpn router Mikrotikvpn router Mikrotik
vpn router Mikrotiktodangkhoa
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Vendic Magento, PWA & Marketing
 
Istio Playground
Istio PlaygroundIstio Playground
Istio PlaygroundQAware GmbH
 
Automating Security in your IaC Pipeline
Automating Security in your IaC PipelineAutomating Security in your IaC Pipeline
Automating Security in your IaC PipelineAmazon Web Services
 
Introduction to aop
Introduction to aopIntroduction to aop
Introduction to aopDror Helper
 
Packer, where DevOps begins
Packer, where DevOps beginsPacker, where DevOps begins
Packer, where DevOps beginsJeff Hung
 
Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksHector Ramos
 
Windows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceWindows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceTechWell
 
Small Python Tools for Software Release Engineering
Small Python Tools for Software Release EngineeringSmall Python Tools for Software Release Engineering
Small Python Tools for Software Release Engineeringpycontw
 
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Frédéric Harper
 

Similar a Newsstand (20)

(ARC401) Cloud First: New Architecture for New Infrastructure
(ARC401) Cloud First: New Architecture for New Infrastructure(ARC401) Cloud First: New Architecture for New Infrastructure
(ARC401) Cloud First: New Architecture for New Infrastructure
 
How to build a server and a iPhone client application using the Apple Push No...
How to build a server and a iPhone client application using the Apple Push No...How to build a server and a iPhone client application using the Apple Push No...
How to build a server and a iPhone client application using the Apple Push No...
 
DevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursDevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office Hours
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleService Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
 
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel AvivSelf Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
Self Service Agile Infrastructure for Product Teams - Pop-up Loft Tel Aviv
 
Scale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App FabricScale Your Data Tier With Windows Server App Fabric
Scale Your Data Tier With Windows Server App Fabric
 
Cloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFECloud Native Identity with SPIFFE
Cloud Native Identity with SPIFFE
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
Orion Context Broker
Orion Context Broker Orion Context Broker
Orion Context Broker
 
System insight without Interference
System insight without InterferenceSystem insight without Interference
System insight without Interference
 
vpn router Mikrotik
vpn router Mikrotikvpn router Mikrotik
vpn router Mikrotik
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
 
Istio Playground
Istio PlaygroundIstio Playground
Istio Playground
 
Automating Security in your IaC Pipeline
Automating Security in your IaC PipelineAutomating Security in your IaC Pipeline
Automating Security in your IaC Pipeline
 
Introduction to aop
Introduction to aopIntroduction to aop
Introduction to aop
 
Packer, where DevOps begins
Packer, where DevOps beginsPacker, where DevOps begins
Packer, where DevOps begins
 
Parse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & TricksParse London Meetup - Cloud Code Tips & Tricks
Parse London Meetup - Cloud Code Tips & Tricks
 
Windows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile WorkforceWindows Azure: Connecting the Dots for a Mobile Workforce
Windows Azure: Connecting the Dots for a Mobile Workforce
 
Small Python Tools for Software Release Engineering
Small Python Tools for Software Release EngineeringSmall Python Tools for Software Release Engineering
Small Python Tools for Software Release Engineering
 
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
Firefox OS, fixing the mobile web - FITC Toronto - 2014-04-28
 

Último

Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfalexjohnson7307
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideStefan Dietze
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 

Último (20)

Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Generative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdfGenerative AI Use Cases and Applications.pdf
Generative AI Use Cases and Applications.pdf
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The InsideCollecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
Collecting & Temporal Analysis of Behavioral Web Data - Tales From The Inside
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 

Newsstand

  • 1. Newsstand Kaz Yoshikawa
  • 2. Why Newsstand? • Contents can be delivered to devices while sleeping • background downloading • Good for subscription type business model • Magazines, Newspaper, Free papers ...
  • 3. How Newsstand Work? ④ Launch with Your Server Background mode ① Launch Time Device Token, etc. ⑤ Download Contents Contents SSL ② When New Issue is Ready Certificate Device Token ⑥ Enjoy Reading Contents ③ Push Notification Apple’s APNS
  • 4. Requirements (Vender) • Server facility • Hosting contents for downloading: • Capable of simultaneous download requests • Push Notifications • Server side programming: i.e. Apache+MySQL+PHP • SSL Certificate *
  • 5. Provisioning Portal Paper Work
  • 9. Provisioning Profiles • Push Notification won’t work on Wildcard provisioning
  • 10. iTunes Connect Another Paper Work
  • 11. Add New App from ITC • In-App-Purchase can only be configured from iTunesConnect •
  • 12.
  • 14. In-App Purchases Auto-Renewable Free Subscription
  • 15.
  • 16. Add Duration and Pricing Duration Sale or not Price Tier
  • 22.
  • 24. ATOM Feed • Apple’s server checks your new issues time to time to update iTunesConnect.
  • 25. Xcode
  • 27. Register Remote Notification - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)options { ! // ... ! UIRemoteNotificationType type = UIRemoteNotificationTypeBadge | ! ! ! ! UIRemoteNotificationTypeSound | ! ! ! ! UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeNewsstandContentAvailability; ! [[UIApplication sharedApplication] registerForRemoteNotificationTypes:type]; }
  • 28. Newsstand Notification • Receive remote notification only once a day • You cannot push two contents a day • You can push regular push notifications multiple time • For debuging: [[NSUserDefaults standardUserDefaults] setValue:@YES forKey:@"NKDontThrottleNewsstandContentNotifications"];
  • 29. Send Token To Your Server with APS Environment - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)token { #if DEBUG ! NSString *aps_environment = @"development"; Why? #else ! NSString *aps_environment = @"production"; #endif ! // send token to your server with other properties aps_environment }
  • 30. Different Token: Development/Production Debug Release APNS production Sandbox development app_id token environment com.electricwoo 0x123...af30 development Your ds.yourmagazine com.electricwoo 0x5c6...78c1 production Server APNS ds.yourmagazine Production
  • 31. Downloading New Issue Your Server APNS ① Push Notification ② Query Issues { Issue name, Published date, Download URL "aps":{ ! "content-available":1, }, ③ Download new Issue ... } Payload ④ Unzip* and move ⑤ Replace Newsstand Icon * optional
  • 32. Downloading New Issue - (void)downloadContentName:(NSString *)name URL:(NSURL *)URL date:(NSDate *)date { NKLibrary *lib = [NKLibrary sharedLibrary]; NKIssue *issue = [lib issueWithName:name]; if (!issue) { issue = [lib addIssueWithName:name date:date]; NKAssetDownload *download = [issue addAssetWithRequest: [NSURLRequest requestWithURL:URL]]; [download downloadWithDelegate:self]; } } - (void)connectionDidFinishDownloading:(NSURLConnection *)connection destinationURL:(NSURL *)destinationURL { ! NSIssue *issue = connection.newsstandAssetDownload.issue; NSString *contentPath = issue.contentURL.path; // unzip destinationURL to contentPath }
  • 33. Restore Downloads at Launch Time ! Don’t forget NKLibrary *library = [NKLibrary sharedLibrary]; ! for (NKAssetDownload *download in library.downloadingAssets) { ! ! [download downloadWithDelegate:self]; ! }
  • 34. Making a list of Issues NKLibrary *lib = [NKLibrary sharedLibrary]; NSArray *issues = [lib issues]; Build a Great Bookshelf
  • 36. Auto-renewable Subscription • Newsstand App requires at least one Auto-renewable subscription or free subscription • Auto-renewable durations are: 7d, 1m, 2m, 3m, 6m, 1y • StoreKit won’t let app know duration from product identifier • Need to query to your server or hard-coded
  • 37. Restore Problem • What if Someone purchased auto-renewable subscriptions in-and-out few times • Purchased records can be retrieved by restore operation • But it can be cancelled, and StoreKit wouldn’t tell me... • Needs to ask to Apple’s server to verify those purchases Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
  • 38. Verifying Receipt - (void)paymentQueueRestoreCompletedTransactionsFinished:(SKPaymentQueue *)queue ! for (SKPaymentTransaction *transaction in queue.transactions) { ! ! NSString *identifier = transaction.payment.productIdentifier; ! ! switch (transaction.transactionState) { ! ! case SKPaymentTransactionStatePurchasing: // ... ! ! case SKPaymentTransactionStateFailed: // ... ! ! case SKPaymentTransactionStatePurchased: ! ! case SKPaymentTransactionStateRestored: ! ! ! [self verifyTransactionReceipt:transaction]; ! ! ! break; ! ! } ! } } - (void)verifyTransactionReceipt:(SKPaymentTransaction *)transaction { ... do your stuff ... [queue finishTransaction:transaction]; }
  • 39. DEBUG Verifying Receipts App Store Production { "receipt-data" : "(receipt bytes here)", "sandbox" : 1 } { "status" : 0, "receipt" : , "latest_receipt" : ... { 0 "latest_receipt_info" : ... "receipt-data" : "(receipt bytes here)", } "password" : "(shared secret bytes here)" OK } Sandbox { "status" : 0, App Store Your Server "receipt" : { (receipt here) }, "latest_receipt" : "(base-64 encoded receipt here "latest_receipt_info" : { (latest receipt info here }
  • 40. PRODUCTION Verifying Receipts App Store Production { { "receipt-data" : "(receipt bytes here)", "receipt-data" : "(receipt bytes here)", "password" : "(shared secret bytes he } } { "status" : 21006, { "receipt" : { (receipt here) }, "status" : 21006, "latest_receipt" : "(base-64 encoded re "receipt" : , "latest_receipt_info" : { (latest receip "latest_receipt" : ... } 21006 "latest_receipt_info" : ... } expired Sandbox App Store Your Server
  • 41. Auto renewable subscription recurring duration Production Sandbox 1 week 3 minutes 1 month 5 minutes 2 months 10 minutes 3 months 15 minutes 6 months 30 minutes 1 year 1 hour Automatically expires in 6th time recurring
  • 42. "receipt" :{ Not Expired "receipt":{ Expired "unique_identifier":"44f9ec48b952a....34e12c61c9c4f", "unique_identifier":"44f9ec48b952a....34e12c61c9c4f", "original_transaction_id":"1000000055744550", "original_transaction_id":"1000000055744550", "expires_date":"1348131173000", "expires_date":"1347344399000", "transaction_id":"1000000056135747", "transaction_id":"1000000055932398", "quantity":"1", "quantity":"1", "product_id":"yourmagazine.1mo", "product_id":"yourmagazine.1mo", "original_purchase_date_ms":"1347343199000", "original_purchase_date_ms":"1347343199000", "bid":"com.electricwoods.newsstand", "bid":"com.electricwoods.newsstand", "bvrs":"1.0", "bvrs":"1.0", "expires_date_formatted":"2012-09-20 08:52:53 Etc/GMT", "expires_date_formatted":"2012-09-11 06:19:59 Etc/GMT", "purchase_date":"2012-09-20 08:47:53 Etc/GMT", "purchase_date":"2012-09-11 06:14:59 Etc/GMT", "purchase_date_ms":"1348130873000", "purchase_date_ms":"1347344099000", "original_purchase_date":"2012-09-11 05:59:59 Etc/GMT", "original_purchase_date":"2012-09-11 05:59:59 Etc/GMT", "item_id":"558725164", "item_id":"558725164" }; }, “status”: 0 "status":21006
  • 44. These are what you get Newsstand Push Notification In App Purchase UIKit
  • 45. This is what you gonna build
  • 46. kyoshikawa@electricwoods.com Thank you Electricwoods LLC