Deployed ROR API to Heroku and broke it - ios

I'm working on a Rails API for an iOS app. I was able to run it on my localhost and consume it from the iPhone simulator but now I want to test on the device. I successfully pushed to heroku and changed my ROOT_URL to be the one that it provided. Now when I visit the application URL (http://sleepy-lake-5504.herokuapp.com/v1/users if you really wanted to know), I get the error message:
Application Error
An error occurred in the application and your page could not be served. Please try again in a few moments.
instead of JSON data.
Am I doing something wrong? Do I need to do something special with heroku to hit it as an API?
Needless to say it's making me very sad.
Any help is appreciated.

You can create a tunnel to your localhost using ngrok. Ngrok will forward your localhost and give you a URL which you can use in your iPhone.
This will help you to debug your localhost without actually hosting your site so that you get a better idea of whats going wrong. Let me know if that helps.

Related

Ad blocker block affiliate page on production but works fine on development?

My front-end code is written in react and back-end code is written in rails. So when i request from frontend to affiliate controller in production it gets blocked by adblocker. Please State me the reason for it??
Also i want that problem to be get reflected in development mode. So what to do for this???
It is because if the request url containg affiliate in the url then adblocker blocks the url. And for reflecting in development mode please use ngrok on the port 3000

Facebook OmniAuth throwing parameter app_id required when deployed on Heroku

So, I've been developing my app locally for sometime now and I decided today that I would like to deploy it on Heroku to start getting initial feedback for the app. I went through the guide on Heroku to help deploy my Rails 5 app to heroku.
Deployment was smooth and I was shown my login page. I clicked on Login Via FB and I was returned a white page with the following error response
The parameter app_id is required
Now, my obvious plan of action was to follow the trail, refer SO and hopefully come up with a solution for this. I tried every plausible resource on the web but I still get this error.
I've even updated my APP_ID and APP_SECRET variables on heroku. I've even updated Valid OAuth Redirect URIs section in my fb developer settings with the appropriate Heroku URL.
The funny bit is that everything works smoothly on my localhost but fails on heroku which is strange.
I strongly believe that Facebook would through appropriate errors and that app_id is in fact not being sent to fb. If this is the case, how do I solve this?
If you need code snippets to look at, do ask what might be needed to be looked at and I shall update my post accordingly.
Thank you!
the solution turned out to be a pretty simple one. In my application.yml file I had saved my Facebook vars as facebook_app_id and facebook_secret_key. But in my Heroku config vars I had included them as FACEBOOK_APP_ID and FACEBOOK_SECRET_KEY. I was under the impression keys aren't case sensitive. When I changed them to lowercase for Heroku, it worked.

Requests to the server blocked, Shopify_app

I am attempting to install my rails app following the guide for the shopify_app gem. I installed it to my dev store on shopify and then i get this screen when trying to access the app.
EDIT: I am getting this in the console:
Refused to frame 'https://localhost:3000/' because it violates the following Content Security Policy directive: "child-src 'self' https://* shopify-pos://*". Note that 'frame-src' was not explicitly set, so 'child-src' is used as a fallback.
Please help me. No clue whats happening.
EDIT: IT seems as though there is an issue loading an iFrame from an http to a https on my shopify app because when I deploy the app to heroku and do it that way the app works...
How can I make it so i can use localhost as dev until im ready to launch?
You probably want to read up on using a service like forwardhq or ngrok. That way you can test and develop localhost, including webhooks, and proxy calls. Works like a peach. Shopify fully documents it, check out their suggestions.

Sending Devise inevitable to staging server

I have the devise_invitable gem and it works great because I don't want anybody to be able to sign up for the app I developing. When I go to rails console I send the invite User.invite(..... everything works great and it sends the email but only for localhost:3000. I want to send it to my heroku staging server. Any ideas on what I may be missing? Please let me know if you need to see code, I'm just not sure what to post right now. Thank you!
Simply heroku run rails console

FB_Graph: An error occurred. Please try again later

I am using fb_graph for my rails app.
I just followed nov/fb_graph app.
It was working fine till last week, i was able yo login and could get user information.
But suddenly i am getting error.
I didnt change anything in my app.
my app_id, screat_id everything is correct.
Even i am getting error when i close that facebook error window like
Graph::Auth::VerificationFailed
Facebook cookie not found
Could any one got through this error
this just because of URL mistake
whatever website url is specified should be correct.
i mentioned website url as http://localhost:3000/ and domain as localhost
but in my browser i was running http://0.0.0.0:3000/ that was the actual problem so i ran server as localhost:3000 now its working fine. Because we mentioned site url as localhost fb will redirect to same, if we r running 0.0.0.0:3000 it will rise error that Given URL is not allowed by the Application configuration.
thank you

Resources