"Network Request Failed" - ios

I'm trying to grab info from: http://api.geonames.org/earthquakesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=demo to display in my app but I keep on getting a "Network Request Failed" error.
I am literally copying and pasting (well i've edited the params a bit of things so that the earthquake data can be taken) the code from Facebook's React Native Movies tutorial (https://facebook.github.io/react-native/releases/0.27/docs/sample-application-movies.html#final-source-code) and replacing
var REQUEST_URL = 'https://raw.githubusercontent.com/facebook/react-native/master/docs/MoviesExample.json'
with
var REQUEST_URL = 'http://api.geonames.org/earthquakesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=demo'
I have already changed info.plist to allow like everything possible.

Are you using the demo account as you have specified in the link?. If so you need to sign in and enable free webservice for your account to get things to work.

Related

Error when downloading Apple Pass in Chrome for iOS

Issue with downloading Apple Pass on an iPhone device using Chrome and Firefox. It works fine on Safari. On Chrome for iOS it says:
Sorry, your Pass cannot be installed to Passbook at this time.
For Firefox it says:
Failed to Add Pass An error occurred while adding the pass to Wallet. Please try again later.
I tried just downloading the Apple Pass from a desktop browser and it downloads and I can install it fine on an iPhone/simulator which I'm assuming is not a problem with the pass itself but maybe rather something I'm missing in the response.
Here is the code I'm using to return the Apple Pass.
private void ReturnResponse(byte[] applePass)
{
Response.Clear();
Response.AddHeader("content-disposition", string.Formate("attachment; filename={0}", "sample.pkpass"));
Response.ContentType = "application/vnd.apple.pkpass"
Response.BinaryWrite(applePass);
Response.End();
}
Expected result:
Apple Pass opens and allows the user to add it to their Apple Wallet.
I realise this is question is over a year and a half old, but this is still an issue as of March 2021. After a lot of trial and error we managed to get it working on Chrome & Firefox. Our specific issue was that the request has to be a GET, and we had a form before the Pass was downloaded that submitted as a POST. Once we change the form to submit a GET the issue was resolved.
We tried to keep the POST and return a 201, which feels correct, but the issue persisted.
Changing our request method from a POST to a GET when serving the pkpass made it possible to download the pass using Google Chrome for Mobile on an iOS device.
This is untested, but I have found this link which I feel might be related:
https://github.com/eymengunay/php-passbook/issues/73
It says that the anchor you using to link to the pass should contain the this attribute:
target="_system"
I have not tested this resolution myself.
I just bought 20 access passes from a website. The site had the option to "add to apple wallet". It worked fine for 19 of them and then on the very last one I got this same error.
I did not do anything different when trying to add the 20th one.
Wondering if there is a limitation with the number of passes you can add?... but why would it be limited to a random number like 19?

Distributing iOS app over-the-air using Firebase

Our organization uses an enterprise account and the itms-services protocol to internally deploy apps over-the-air.
Our plists and ipas are hosted on Amazon S3 and everything works as expected - you click a link and an alert pops up asking if you'd like to install the app.
We are now trying to store our files on Firebase storage and send out links in the following format:
itms-services://?action=download-manifest&url=https://firebasestorage.googleapis.com/v0/b/my-app.appspot.com/o/MyApp.plist?alt=media&token=my-token
Pasting this link in Safari opens a dialog asking: 'Open this page in "iTunes"?' Clicking on open does nothing.
It's worth mentioning that if I upload the same plist/ipa combo to S3 it works fine. Also, if I paste the url itself (without the itms-services part) I am able to download both plist and ipa.
Why don't I get the dialog asking if I'd like to install the app? I have a feeling that it's somehow related to an issue with permissions to Firebase but as I am able to download the file directly I'm not really sure.
Your url should be encoded.
For example:
Normal url: https://firebasestorage.googleapis.com/v0/b/my-app.appspot.com/o/MyApp.plist?alt=media&token=my-token
Encoded url: https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fmy-app.appspot.com%2Fo%2FMyApp.plist%3Falt%3Dmedia%26token%3Dmy-token
Finally: itms-services://?action=download-manifest&url=https%3A%2F%2Ffirebasestorage.googleapis.com%2Fv0%2Fb%2Fmy-app.appspot.com%2Fo%2FMyApp.plist%3Falt%3Dmedia%26token%3Dmy-token
gfvilela's solution worked in 2017 and if you have spaces you still need to do that but there is a new issue where firebase removes the // after itms-services: in redirects.
I used https://www.redirect-checker.org/index.php to check what my redirect actually redirects to and it shows that it's leaving out the //:
itms-services:?action=download-manifest&url=...
Somehow this still opens the popup "Open this page in Itunes" but it will not open the next popup "<domain> would like to install <app>" probably because the Itunes process that is opened parses the URL different from how iOS handles deeplinks.
I can only speculate but I think the problem with firebase removing the // lies with how they handle : since they use it with their "glob" pattern matching: https://firebase.google.com/docs/hosting/full-config.
Attempts
I tried encoding the entire URL, just the // part and even only the : but all of these redirect to mydomain.com/itms-services....
I tried using the Dynamic Links module but that doesn't support this either:
Please enter a valid URL starting with http:// or https://
Solution
I think the only way to do this using firebase is to redirect using functions similar to this question: Cloud function for firebase to redirect to a URL
This is definitely more work and is not included in the free firebase package but here is how I solved it:
run firebase init functions
Write the redirect in functions/index.js
exports.downloadApp = functions.https.onRequest((req, res) => {
res.redirect(302, 'itms-services://?action=download-manifest&url=<YOURMANIFEST>');
});
Run firebase deploy --only functions
In your firebase.json add a rewrite (not redirect) to the function:
"rewrites": [
{
"source": "/app",
"function": "downloadApp"
}
]
Run firebase deploy --only hosting
Note
This is an awful lot of workaround just because firebase doesn't have an escape character for : for when you don't want to use it for "glob" pattern matching.

Instragram send like to image show error for app

I have created app on Instagram and got access token and client Id.
My issue is that when I send like to image using API method that is showing me error:
meta = {
code = 400;
"error_message" = "you cannot like this media";
"error_type" = APINotAllowedError;
};
}
So like is not being sent to Image. I can explicitly able to like that image from the Instagram app. So may be the issue is not related to image's privacy. Can anyone help me for this issue?
Thanks in advance
************** Edit **************
After I check I am able to send Like from the API consol of the instagram for same media_id with response 200/OK. But from my app issue is still there.
Can I solve this by changing the APP ID AND APP SECRET ?
Please reply
1 - Double check if you are using correct access token
2 - How much likes did you in a hour? Pay attention to it and respect the limits. Take a look here: http://instagram.com/developer/limits/

"There are no Facebook accounts configured" error message on iOS when use IS logged in via Settings - app built with Corona SDK

One of our users is getting the following error when they try to post from the native popup:
No Facebook account.
There are no Facebook accounts configured. You can add or create a Facebook account in Settings.
However they assure me that they are signed into Facebook via Settings, and they are still able to post from one of our other apps. All other test users can post directly without any issues, and afaik it worked in the past in this app for the user who is currently experiencing problems.
It seems like it's most likely an OS issue rather than an issue in my code, I simply request that the native popup be shown and pass an image and some text through (these are still being pushed to the native popup correctly):
if native.canShowPopup( "social", "facebook" ) and system.getInfo("platformName") ~= "Android" then
local function socialFBListener(e)
if e.action == "sent" then
print("FB post sent successfully")
end
end
local options = {
service = "facebook",
message = "Here is some testing text",
listener = socialFBListener,
image = {
{ filename = "testImage.jpg", baseDir = system.DocumentsDirectory },
},
url = "http://quixtix.co",
}
native.showPopup( "social", options )
end
I can't find any reference to anyone receiving this error when they are signed in, all links I could find simply tell you how to sign in.
Error was due to a fault on the user's device. After updating iOS and restarting the device the problem went away.
I have the same problem. But its due to I was forgot to set my app as
'Public'
it can be done by,
Goto https://developers.facebook.com -> App Review
Set Make 'appName' public? to YES.
For anyone who are struggling with this issue at the moment, the solutions are worked out like this:
Delete the Facebook account at iOS "Settings".
Try to connect with your Facebook account at your app again.
Get success
Add the Facebook account back to iOS "Settings" again if you'd like.
Cheers.

iOS 6 SLComposeViewController - creating a facebook post with text and URL - no image

Quite simply unable to make a post with just the text and NSURL object. I can do it with just the post, or with the post, NSURL and image, but ideally I'd just like to provide the link with the post.
It simply states "Cannot post to Facebook" as "The post cannot be sent because the connection to Facebook failed."
Is there anything I can do? I'm not using the Facebook SDK at the moment, but perhaps I might have to?
Many thanks
We just started running in to this issue with code that was working correctly yesterday. Googling shows a lot of people having this issue sharing from other Apple apps today via native integration. I actually think this is an issue on Facebook's end.
I tried sharing a URL from Mobile Safari and it too fails with the same error. Can you confirm that Mobile Safari also fails to share?
Well for now I'm able to leave the image part nil (still include the method, just leave the argument nil) and it will show the text and link only.

Resources