Skip to content

A demo iPhone application intended as an educational tool for demonstrating how Amazon IVS can be used to build a compelling customer experience for eCommerce use-cases.

License

Notifications You must be signed in to change notification settings

aws-samples/amazon-ivs-ecommerce-ios-demo

Repository files navigation

Amazon IVS eCommerce iOS Demo

A demo iOS application intended as an educational tool for demonstrating how Amazon IVS can be used to build a compelling customer experience for eCommerce use-cases.

Amazon IVS eCommerce iOS demo screenshots

This project is intended for education purposes only and not for production usage.

This is an iOS application that uses Amazon IVS TimedMetadata to show products. The demo is written in Swift and showcases how customers can load and play an Amazon IVS stream and display browsable product information using TimedMetadata.

This demo uses a 24/7 looping stream which emits a TimedMetadata event every few seconds. These TimedMetadata events describe product information in json format, which is used by the app to show a carousel of products, and to highlight the product being shown on stream.

Getting Started

To run this demo, you will need the following:

  1. Xcode 11 or greater. You can build this application for devices running iOS 10 or later.
  2. Cocoapods, installed and up-to-date. You can quickly install cocoapods from Terminal with sudo gem install cocoapods.
  3. Bundler, installed and up-to-date.
  4. Git installed and up-to-date. You can quickly install git from Terminal with xcode-select --install.

To run the demo in the iOS Simulator:

  1. Clone the project from this repository
  2. Navigate to the project directory using Terminal
  3. Run pod install
  4. Open eCommerce.xcworkspace in Xcode.
  5. Click Run in the toolbar, or press Cmd(⌘)-R

You should see the iOS Simulator boot up and launch the demo app. This may take a few moments to complete.

Modifying this Example

Prerequisites

IMPORTANT NOTE: Using your own stream will create and consume AWS resources, which will cost money.

  1. Create and set up an Amazon IVS channel. Getting started with Amazon IVS.

Using your own Live video

  1. Open the Amazon IVS Console and navigate to the channel you would like to use.
  2. Copy the Playback URL for the channel. The URL should end in .m3u8. (For example: https://4c62a87c1810.us-west-2.playback.live-video.net/api/video/v1/us-west-2.049054135175.channel.onToXRHIurEP.m3u8).
  3. In Xcode, open eCommerce/Constants.swift.
  4. Replace the string on line 12 with the Playback URL from step 2.
  5. Save and build the application. Navigate to the leftmost image in the LIVE carousel to view landscape video, or the second-to-leftmost image to view portrait video.

Using your own TimedMetadata events

Amazon IVS TimedMetadata provides a way to embed metadata in an Amazon IVS stream. It ensures that your users receive the metadata at the same time as the video stream, regardless of stream latency or geographic location. Learn how to embed TimedMetadata in stream: Embedding Metadata within a Video Stream.

This example expects a productId that represents the unique identifier for a project in the streams.json file.

"metadata" : {
  "productId": "1000567892"
}

Additional Notes

For production applications, we recommend using TimedMetadata alongside services like AWS Lambda, Amazon API Gateway, and Amazon DynamoDB. These services will let you store and retrieve product information in a more scalable way. See the Amazon IVS eCommerce Web Demo for example code using these services.

Documentation

Known Issues

  • The application was written for demonstration purposes and not for production use.
  • Currently only tested in the us-west-2 (Oregon) region. Additional regions may be supported depending on service availability.

License

This sample code is made available under a modified MIT license. See the LICENSE file.

About

A demo iPhone application intended as an educational tool for demonstrating how Amazon IVS can be used to build a compelling customer experience for eCommerce use-cases.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published