WalmartSDKKit 1.0.0

WalmartSDKKit 1.0.0

TestsTested
LangLanguage Obj-CObjective C
License Custom
ReleasedLast Release Jun 2016

Maintained by Siddhant Goyal.



  • By
  • @WalmartLabs

Walmart SDK for iOS

Walmart SDK is designed to let you drive sales right in your app or on your website. SDK components like BuyNow button can be placed next to a product offering on the website or in a mobile application and it can be configured to directly add the product to the cart on Walmart.com. With the Buy Now button, you can remove friction in purchase by reducing the number of steps required for a consumer to purchase an item from walmart.com and hence see an increased conversion rate.

Requirements

  • Xcode 7.2 or later
  • iOS 8.0 or later

Installation

Installation with CocoaPods

CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects.You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.0.0+ is required to build WalmartSDKKit 1.0.0.

Podfile

To integrate WalmartSDKKit into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'MyApp' do
    pod 'WalmartSDKKit', '~> 1.0.0'
end

If you are using Swift, be sure to add use_frameworks! and set your target to iOS 8+:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
    pod 'WalmartSDKKit', '~> 1.0.0'
end

Then, run the following command:

$ pod install

Configure your Xcode Project

You will need a publisher Id to use the SDK. This is either provided by Walmart or if you are a Rakuten publisher, then Rakuten publisher Id can be used. You can SignUp here Now configure the .plist for your project:

  1. In Xcode right-click your .plist file and choose Open As Source Code.
  2. Copy & Paste the XML snippet into the body of your file (<dict>...</dict>).

    <key>WalmartPublisherId</key>
    <string>{your-publisher-id}</string>
  3. Replace:

    {your-publisher-id} with your publisher Id

Preparing your apps for iOS 9

If you compile your app with iOS SDK 9.0, you will be affected by App Transport Security. Currently, you will need to whitelist Walmart domains in your app by adding the following to your application's plist

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>walmart.com</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSExceptionMinimumTLSVersion</key>
            <string>TLSv1.0</string>
            <key>NSExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

Getting Started

In order to our SDK Demo app, use

$ pod try WalmartSDKKit

Read more here about how to initialize the SDK and use components like BuyNowButton.

Fixing Xcode's "Include of non-modular header inside framework module" Error

If you are receive an error when compiling about "Include of non-modular header inside framework module". you can resolve it by :

Set your project target's CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES flag to YES. This configuration setting can also be found under your target's Build Settings > Allow Non-modular Includes in Framework Modules within Xcode.

Here's more information from Apple's Developer Forums regarding the issue: https://forums.developer.apple.com/message/78028

The compiler will run into issues if the same header file is accessible both through Header Search Paths (-I, -isystem) and Framework Search Paths (-F, -iframework), even if there are symbolic links involved. In these cases, you should prefer using Framework Search Paths. (Note that this invalid configuration may be generated by external systems, such as CocoaPods.)

Author

@WalmartLabs

License

See the LICENSE file for more info.