Shopify同步购物车与客户

时间:2016-12-01 12:31:57

标签: ios objective-c shopify

[self.client loginCustomerWithCredentials:credentials callback:^(BUYCustomer * customer, BUYCustomerToken * token, NSError * _Nullable error) {
            if (customer && !error) {
                self.appDelegate.cart = [self.client.modelManager insertCartWithJSONDictionary:nil];
                NSLog(@"Success fully loged in token %@ %@",token.accessToken,token.customerID);
                UINavigationController *navigationController = self.navigationController;
                [navigationController popViewControllerAnimated:YES];

            }else{
                [self showEror:@"LogIn Failed" message:@"Please provide valid Details"];
            }
        }];

在成功登录后的上述代码中,我尝试为用户创建购物车。然后我将商品添加到购物车,但当我关闭并重新打开应用程序时,购物车是空的。

如何为用户创建购物车,以便他们能够在任何设备上访问它?

0 个答案:

没有答案