Shopify / mobile-buy-sdk-ios

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
451 stars 198 forks source link

Version 2.0 Milestone #112

Closed bgulanowski closed 8 years ago

bgulanowski commented 8 years ago

iOS Buy SDK 2.0

Overview

Shopify's APIs are evolving, and the Buy SDK is being revised to keep in sync. The next version of the SDK is underway, with a targeted release date for the end of April, 2016. Many of the features of the next version area already in use in private projects within Shopify. Over the next few weeks, we'll be cleaning up and deploying those features into this repository.

New 2.0 changes will be integrated on the version-2 integration branch. When it's ready, it will take over as the master branch. The current develop branch will be renamed and deprecated at that time.

Goals for Buy SDK 2.0

The Shopify data model will be represented by a Core Data Managed Object Model. It's a rarely exploited fact that the Managed Object Model classes are useful even without a Core Data persistence stack. We've converted the old models, and are generating new model class files with mogenerator. Some model types and property names will be updated to be more consistent with Apple Objective-C naming standards.

Hand-written JSON serialization will be replaced with a fully dynamic solution relying on extensions to the Core Data model description classes: NSEntityDescription and NSPropertyDescription (and subclasses: NSAttributeDescription and NSRelationshipDescription). These will implement a set of reasonable conventions for JSON<->model transformations. But, they can be customized using user info settings defined in the model file to support variations, including custom key mappings, custom data formats, custom relationship mappings, transient-only properties, documentation, and more.

Model object lifecycle will now be owned by a model manager (BUYModelManager), to ensure creation and deletion of objects is properly tracked. The BUYClient will instantiate new models via BUYModelManager when processing responses from Shopify APIs.

Project Management

The new version of the SDK will continue to be written in Objective-C, to ensure support for apps written in both Objective-C and Swift.

We will be looking at improvements to the current target structure, but may have to defer significant changes to a later milestone.

In the short term, we will be making a few small changes to allow opt-in for some features. The first optional feature will be for Core Data caching support. Because model objects in Core Data must inherit from NSManagedObject, a build setting will allow enabling Core Data support. This will change the default inheritance of model classes. It will also conditionally compile some methods either on BUYObject, or BUYManagedObject, to ensure a consistent interface, regardless of whether the feature is enabled. Input from 3rd party developers is desired, regarding these designs.

Note that full support for Core Data-based caching is not a goal of this new version. At the moment, we want to limit the growth of complexity of the SDK for the majority of users. Developers who wish to opt in to local data caching support must have the experience to manage a Core Data persistence stack. Furthermore, they are strongly recommended to contact their Shopify representative for information about joining our Shopify Plus program.

Milestone Issues

cc @davidmuzi @dbart01

neywen commented 8 years ago

Hello, This is very interesting, I'm actually finishing to develop an iOS app using the Mobile Buy SDK. I had to implement a customer signup/login using a third-party service, when I understood that was not available in the SDK 1.0.

But the biggest problem I'm facing right now is that I can't store and retrieve the customer credit card's info. I thought about storing them in the device's keychain, since it's protected with the developer identity. But I have no guarantee that is sufficient enough to match the security norms of credit card storing. What I wish is the possibility to use a paiement gateway like Stripe, to associate a credit card with a customer, and be able to automatically retrieve the credit card info at a later order. For now, I have to tell my client that his users will have to enter their credit card info each time they want to make an order, and that is a problem, it's much less ergonomic than he expected.

Would you have any information about that ? Is such a feature will be available in the SDK 2.0 ? Would you recommend any particular method to handle that issue ?

Thanks, loïc b.

bgulanowski commented 8 years ago

Hi, neywen.

Please take general questions and support requests to the Shopify developer help forums, here: https://ecommerce.shopify.com/c/shopify-apis-and-technology

If you have new issues, bugs, or feature requests, please use the Github "New Issue" button. Please try to keep issues separate.

bgulanowski commented 8 years ago

As for your question, no, we will not be providing support for credit card storage in version 2.0, and I cannot currently offer any timeline for such a feature.

neywen commented 8 years ago

Thank you for your answer, I understand your point. The problem is the forum does not answer every question, I still have opened issues. And my main question here was about the roadmap : will the SDK 2.0 allow to manage credit card info caching ? I'll stay tuned if this question can not be answered here. Thanks ! l.

neywen commented 8 years ago

Our messages crossed each other :) thanks, l.

bgulanowski commented 8 years ago

This issue has been updated with links to specific issues for this milestone.

teknofreek commented 8 years ago

Hi, when can we expect version 2.0 to be released? Thanks.

bgulanowski commented 8 years ago

I'm sorry, but we can't provide release estimates. Also, please do not spam the github issues. It's not polite.