I am doing in-app purchasing in Mac as well as iOS app.
What we have understood when a sandboxed environment receipt is validated against https://buy.itunes.apple.com/verifyReceipt we get the status code as 21007: CargoBayStatusSandboxReceiptSentToProduction.
This works perfectly in iOS, but for the Mac app the result is different.
I have a valid Sandboxed Environment receipt in my Mac app which I verified using the https://sandbox.itunes.apple.com/verifyReceipt.
When I verify the same receipt with https://buy.itunes.apple.com/verifyReceipt I need to get back the status code as 21007, but that is not happening. Instead, I get the following response:
<html><head><title>Error</title></head><body>Your request produced an error. <BR>[newNullResponse]</body></html>
Basically if I submit this app in Mac app-store for verification and the Apple guys use test IDs, I will get a sandbox receipt which will fail with status code for production URL receipt validation and then I can fall back to sandbox URL for receipt validation. But as described, the response does not contain a valid status code.
I have executed the following commands in the terminal:
Encode receipt using base 64 encoding, where receipt is the path of the receipt file:
base64 -i receipt
Post data to verify the receipt:
curl -d '{ "receipt-data": "<your b64 string here>" }' https://sandbox.itunes.apple.com/verifyReceipt
or
curl -d '{ "receipt-data": "<your b64 string here>" }' https://buy.itunes.apple.com/verifyReceipt
Response for production URL is :
<html><head><title>Error</title></head><body>Your request produced an error. <BR>[newNullResponse]</body></html>
Ideally it should be {status code = 210007}. Did anybody face this issue before? Or am I missing anything?
For implementing IAP in MAC app is same as in iOS with below change. You need to make binary file after adding below code in
-(void)applicationDidFinishLaunching:(NSNotification *)aNotification {
NSString *receiptPath = [[[NSBundle mainBundle] appStoreReceiptURL] path];
// Test whether the receipt is present at the above path
if (![[NSFileManager defaultManager] fileExistsAtPath:receiptPath]) {
// Validation fails
exit(173);
}
}
This code will create receipt for your MAC. So, after it you can check IAP in your application. Please check that you are doing same.
A sandbox receipt is different from an iTunes receipt. You said the error hapens when you send your sandbox receipt to https://buy.itunes.apple.com/verifyReceipt. But this service is intended for iTunes store receipts. Don't mix them up.
Related
I'm getting really frustrated with the new Instagram API, what I need to do is just get things like pictures, comments, and likes from my Instagram feed. I'm following all the steps that they mention over here https://developers.facebook.com/docs/instagram-basic-display-api/guides/getting-access-tokens-and-permissions, but I'm still not able to get the final access token I need in order to interact with the API. After getting a lot of different errors now I'm stuck with:
{"error_type": "OAuthException", "code": 400, "error_message": "Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request"}
I have verified everything in my Facebook developer setup and everything is ok, the OAuth URL is identical to the one I'm using in the curl command in order to return the access_token and all the setups seem fine. I have noticed that a lot of people are having the same problems but I can't find something that works for me.
This is the way I'm trying to retrieve the access_token:
curl -X POST https://api.instagram.com/oauth/access_token -F client_id=[client_id] -F client_secret=[code] -F grant_type=authorization_code -F redirect_uri=[url] -F code=AQDJxpW5h4r..
I have read that people are using postman and apparently it works over there but I don't know how to use it, any help will be really appreciated.
Upgrade on this, I was finally able to get the access_token via Postman and when I'm trying to use it now I got this error:
{"meta": {"code": 400, "error_type": "OAuthAccessTokenException", "error_message": "The access_token provided is invalid."}}
This is really disappointing, everything was working just fine before this API change. Any ideas?
Just review of the following in your checklist again:
APP_ID and APP_SECRET of "Instagram APP", which is a product added in the Facebook App.
Access Code once submitted in POST request using CURL or Postman, will become invalid for the next request.
The Website Platform is added in "Facebook App".
Test Instagram Users are added and are not pending.
Lastly, Authenticate using the Instagram Test User Profile.
I had the same issue, and actually lost some time solving it.
In my case I only made the configuration in Instagram Product but didn't change the configuration in the login by facebook product.
In summary, you should have in your app in Facebook developers, two products, one Login by Facebook and the other one Instagram. Both must have the same redirect URL.
Hope this helps.
I am starting to build an app that authenticates to a third party web service, and I'm having problems getting the authentication working. The login page is displayed correctly, but once the user logs in an error message is displayed: "The URL can't be shown".
I'm working on the iOS version of my app first, so I've only tested this on iOS so far using the Simulator. I initially thought that I wasn't registering the URL scheme for the redirect URL correctly, but if I put a breakpoint in AppDelegate.OpenURL(), and enter a URL with my URL scheme in Safari my app is launched.
Handling the OAuth2Authenticator.Error event didn't give any more information beyond the same error message.
This is my first time working with Xamarin Forms and Xamarin Auth, so I'm not sure what else to do in order to debug the problem. What else can I do in order to figure out the root cause of this error?
Turns out this was due to user error.
The redirect URL I was using didn't match the redirect URL I registered with the web service. Once I made them the same, the redirect URL worked as expected.
im am experiencing problems with the email validation in the appcelerator platform. I have everything configured right and the email arrive in my inbox when a new user is created, but, for some reason, the link to activate the account returns: Fail to confirm user. 400 Bad Request - Invalid app key
I checked in the tiapp.xml and checked if the api keys are properly configured and everything is alright. I have no idea of how appcelerator generate this link to verify what happen. In my template uses the link below:
https://cloud.appcelerator.com/users/confirmation?key={{key}}&confirmation_token={{confirmation_token}}
What im doing wrong? =[
Seems that the documentation is wrong. Only works if the link in the template is https://platform.appcelerator.com/#/users/confirmation/{{key}}/{{confirmation_token}}
I just encountered the same issue and can confirm the bug in the documentation. The correct url is indeed
https://platform.appcelerator.com/#/users/confirmation/{{key}}/{{confirmation_token}}
I'd like to add that there is probably a similar defect in the following documentation for password reset url:
http://docs.appcelerator.com/arrowdb/latest/#!/api/Users-method-request_reset_password
The documentation says the password reset url (if using Appcelerator instead of custom website) should be
https://dashboard.appcelerator.com/#/users/confirmation/{{key}}/{{confirmation_token}}
It seems wrong (copy-paste from email confirmation url perhaps).
In my Android project, I am trying to connect to the Worklight server (CLI) but after the client.Connect() method call, when I look at the task result, it has an error message saying Error retrieving device data and HTTP status 500. However, I can see the activity count increasing in the Analytics portal.
I am following the sample that comes along with the Xamarin Worklight SDK. All I did was changing the Realm to another one and stripped out irrelevant methods and kept the ConnectAsync & Connect methods alone.
If I run the Worklight sample application that comes along with the SDK, I don't see this error in the task. It gets back a HTTP 200 and everything looks good.
Here is the code, for clarity sake.
private async Task<WorklightResponse> Connect()
{
//lets send a message to the server
client.Analytics.Log("Trying to connect to server", metadata);
ChallengeHandler customCH = new CustomChallengeHandler(appRealm);
client.RegisterChallengeHandler(customCH);
WorklightResponse task = await client.Connect();
//lets log to the local client (not server)
client.Logger("Xamarin").Trace("connection");
//write to the server the connection status
client.Analytics.Log("Connect response : " + task.Success);
return task;
}
This probably has to do with you Android app permissions. Edit your Android project options. In the Android Application->Required Permissions list, select the appropriate permissions. For example, one of my apps requires:
AccessNetworkState
AccessWiFiState
GetAccounts
Internet
UseCredentials
WakeLock
WriteExternalStorage
I have received the same error message without the appropriate permissions. Your list may vary depending on requirements.
By default, the SubscribeServlet is tied to a rejectAll login module which rejects all login requests. If you have not changed the login module, then this is probably why you're seeing your login rejected.
Try changing the login module to a different one if you're using the rejectAll login module
I have setup simple demo for MDM server. I can successfully recover initial plist with messagetype, pushmagic token, APNs token(32byte as base46) and unlocktoken. My issue is when I tried to decode APNs token using base64_decode php function, it returns with junk/garbage character. Can any help if I need to use anyother php function to decode APNs token?
Thanks,
Viral.
The token is just what it is: a token. What you're getting with base64_decode is just a byte-array, you cannot see any meaningful data in it or print it as a string. Just store it in binary form in your database. You need this token later on to identify the target device when you send a pending command notification to the APNS. It is the actually the same as a push-token for an app.
The content of the notification for the device is described in 1, and the APNS protocol in [2].
References
Apple Inc, Mobile Device Management Protocol Reference
Apple Push Notification Service
Just to add onto this. If you're using another library to abstract sending notifications, sometimes they expect the token to be 64 characters. With PHP, you can do this with $token = bin2hex(base64_decode($deviceToken));
However if the token is stored in your database as binary format, then the base64_decode can be omitted. The following is what is required when dealing with PHP PDO w/ Postgres:
bin2hex(stream_get_contents($deviceToken))