Requests to the server blocked, Shopify_app - ruby-on-rails

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.

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.

Deployed ROR API to Heroku and broke it

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.

deugging login error canvas app - rails - facebooker

I have inherited an app set up using built using rails using the facebooker gem. It's hosted on heroku.
I'm getting reports of users getting the following error when they try and grant permissions -
An error occurred with . Please try again later.
I've had a look through heroku's logs and can't see any errors.
Any advice on how I should debug this?
I'm going to answer my own question. I presume no one else will due to the abysmal lack of information that I provided.
the reason I'd not encountered this error before was because Facebook forced a relocation of apps to secure servers recently.
I'd neglected to change my app url in my login javascript to 'https'
Firefox & chrome did not notice the difference. Internet explorer 7 did.
In a nutshell - make sure you have the correct domain name in your facebook app settings.

Public URL for localhost app, to use with Facebook

I am developing an app on rails 3.1 that will be using the facebook registration plugin. I am following this tutorial to do the integration. However, while i am developing my application on localhost:3000, when i create my facebook application on facebook, I need to enter a public URL for the application.
Currently i am using this awesome gem (localtunnel) to get me a public URL and it works fine. However the problem is that the URL it provides is just temporary until i restart localtunnel. Is there a way I can get a constant URL (any ugly url will do) so that I can continue development with facebook while facebook can also access my localhost:3000 through a public URL?
Localtunnel: http://progrium.com/localtunnel/
Hi' if it's still relevnt constant URL - https://ngrok.com/
works great
I didn't have an problem setting the Facebook app url to localhost:3000. Have you tried that? It works fine as long as you're testing it on a computer with the rails server running.
If that doesn't work, you might consider using a no-ip technology: www.no-ip.com (it's free for a subdomain)
you can use lvh.me:3000 as an alternate to localhost.
http://veerasundaravel.wordpress.com/2011/11/13/localhost-alternates-for-subdomain/
Install the heroku gem and upload your app there.

Resources