php - How to redirect Add to cart url page -


i have app e-commerce , adding product id , quantity addcart. here i'm checking static sample value , passing value url checking purpose. if value matches need redirect add cart url page. in browser it's working. in mobile app when click button need check if value same need redirect. it's not redirect.

    int i=2;            nsstring *post =[[nsstring alloc] initwithformat:@"password=%d",i];          nslog(@"postdata: %@",post);            nsurl *url=[nsurl urlwithstring:[nsstring stringwithformat:@"http://serverurl.net/projects/ar/create_cart.php?id=%d",i]];           nslog(@"url %@",url);    nsdata *postdata = [post datausingencoding:nsasciistringencoding allowlossyconversion:yes];           nsstring *postlength = [nsstring stringwithformat:@"%d", [postdata length]];           nsmutableurlrequest *request = [[nsmutableurlrequest alloc] init];          [request seturl:url];          [request sethttpmethod:@"post"];           [request setvalue:postlength forhttpheaderfield:@"content-length"];          [request setvalue:@"application/json" forhttpheaderfield:@"accept"];          [request setvalue:@"application/x-www-form-urlencoded" forhttpheaderfield:@"content-type"];          [request sethttpbody:postdata];           //    [nsurlrequest setallowsanyhttpscertificate:yes forhost:[url host]];           nserror *error = [[nserror alloc] init];          nshttpurlresponse *response = nil;          nsdata *urldata=[nsurlconnection sendsynchronousrequest:request returningresponse:&response error:&error];           nsstring *responsedata = [[nsstring alloc]initwithdata:urldata encoding:nsutf8stringencoding];           nslog(@"response code: %d", [response statuscode]);             if ([responsedata length]){           nslog(@"response ==> %@", responsedata);           nsmutabledictionary *dict=[responsedata jsonvalue];            nslog(@"dict %@",dict);           nsinteger success = [(nsnumber *) [dict objectforkey:@"success"] integervalue];           nslog(@"%d",success);          if(success == 1){             } 

it's not clear e-commerce platform you're using. in case happens magento, here's how can redirect users signing in within ios app: https://github.com/mobstac/justpaws/blob/master/mobstacshop/authviewcontroller.m .

we faced same problem , resolved capturing webview's response.


Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -