bookmark button fails to load the canvas - facebook

when using my app bookmark button that is displayed in the top right of any canvas application interface (apps.facebook.com), I don't get my app loaded/reloaded in the iframe, the iframe show the "loading" animation but ends void with only the facebook footer
the link of the bookmark is correct: it will load successfully the app if pasted in a new browser window; the URL of the apps.facebook.com interface change to the correct URL clicking the bookmark but the application is not loaded, but forcing a reload of the whole browser page the app is correctly loaded... it seem that the iframe loading fails but not the js URL edit
I'm puzzled because checking my server log I don't catch any request from facebook for the canvas page, therefore it is failing before
anybody has observed any similar behaviour?

As Claudio Felicioli figured it, you must set the App Namespace.
https://developers.facebook.com/apps/
On the left, Click on your application
Click Edit Settings
Type information for App Namespace
Click Save Changes

Related

Facebook App: Nothing happens when trying to add domain

I've made a Facebook app to implement fecebook login on my php Saas solution.
I can't add a domain in the settings->advanced section.
A dialog is shown. I write the domain and click the [add] button. Now a spinner is showing and just keeps spinning. I've tried everal computers and mobile devices. It is the same everywhere.
What do I do wrong?
I have set the domains in then settings -> basic sections and I have added all the url callbacks.
image af dialog with spinning button - with protocol
EDIT: It is the same thing with or without protocol. The placeholder in the field states to enter an URL but either with or without the protocol part nothing happens.
image af dialog with spinning button - without protocol

Ionic2 - Login and then Side menu

I am creating an App with Ionic2 and the requirement is -
- the app when first loaded will show a Log In page and when logged in
- will have a Side-Menu enabled pages
The starter project shows that the Side Menu as the root of the app and loads first before any other page is open - then it loads the other related pages.
How can I build an app that Loads Log In page first and then set the Side Menu as the main navigation and never shows up the Log In screen??
I did this with ionic 1 but not being able to figure out with ionic2
Please help.
One solution would be to disable menu on Login screen and then to enable it after login.
You can disable menu by injecting MenuController and then use:
import {NavController, MenuController} from 'ionic-angular';
ionViewDidEnter() {
//to disable menu, or
this.menu.enable(false);
}
ionViewWillLeave() {
// to enable menu.
this.menu.enable(true);
}
#Digital IQ, you have to set your login page as the rootPage in your existing app.ts file and use MenuController in login page to make menu enable onPageDidLeave.
The example for this is available in ionic conference app where they have tutorial page before getting in to the actual application. Refer this for menu control and this (line 50) to set the initial page.
The above problem must have occurred because the user had surely logged in, but the changes i.e. setting it as the current user didn't take place in side menu page.
For that you can use Events API
Events is a publish-subscribe style event system for sending and responding to application-level events across your app.
For reference, go through the following answer-
Ionic 3 refresh side menu after login
kind Attn [vahid najafi & Aish123]
I tried something more easy and I found it working.
I set the LogIn page as the root when the app first loaded - and I removed 'menuToggle' button from this template.
Then I imported the Component I want to redirect on Log in
I created a singIn function in LogInPage class as follows:
signIn (){
let navRef = this.app.getComponent('nav');
navRef.setRoot(HelloIonicPage);
}
and it worked like a charm

How to trigger camera from a remote html page loaded in childbrowser in ios ?

I need to access camera from a remote html page. I load this html page through child browser . Need to open camera or any native view on a button click on html file..
No sure if this is the best/most elegant possibility, but it should work:
By click on button load an specific URL.
The UIWebView has delegate methods to inform you, when a page finished loading.
In the – webViewDidFinishLoad: method check if the loaded URL was your specific button URL, if YES show camera/any other native view.

Facebook dialog content doesn't move window to screen

I'm trying to pop open an apprequests dialog using the following cod:
$("#fbInviteButton").click(function(){
FB.ui({
method: "apprequests",
message: "Test"
};
});
When the button is clicked, a box pops up with the loader and just sits there. In the developer console in Chrome, I can see the ajax request complete and content come back.
When I look at the HTML source, I see the other dialog (class: "fb_dialog fb_dialog_advanced"), with populated content, and when I toggle the CSS for that window:
top: -10000px
the dialog with content comes into view.
So for some reason, when the content is loaded, it doesn't pop into place and replace the loader. Any idea what would cause this?
The application is Ruby on Rails using the Asset Pipeline.
I believe a bug in Facebook's JavaScript SDK causes this problem. I am currently using an older version of SDK taken from here as a workaround.

Prevent cached iPhone webapp from reloading (scrolling to top)

I have an iPhone webapp that uses a cache manifest to work offline. I add the webapp to my home screen, use it (say scroll to a certain location on a page), then go back to homescreen.
When I open the app again, for a brief moment I see where I used to be (at that scrolled location on that page), but then the app "reloads" and I get scrolled to the top of the mainpage. Is there a way to prevent this "reloading"? This happens even in airplane mode (ie everything is working off the cache).
You're just seeing the default startup image, which is just a screenshot of the last place you were at. It's not "reloading"; the app wasn't loaded to begin with.
Search for "apple-touch-startup-image" to set a real loading image.
What I'm struggling with here is that the app actually seems to stay "in memory" longer if I use regular Safari as opposed to running in "apple-mobile-web-app-capable" mode. In the later case something as simple as pressing the home button, then task-switching back to the app causes a reload. Doing the same thing just in Safari often does not reload. So I'm worse off by using "apple-mobile-web-app-capable".
I don't believe there is a real 'reload' event. onload and onunload are all we get.
the onload handler starts up as if it is your first time coming to the page.
the onunload handler is the key to clearing out old content.
I like to provide alternate content for people who are coming back to my web app.
window.onunload=function(){
document.getElementsByTagName('body')[0].className+=' unloading'
}
And let the CSS do the dirty work to hide most of the body and show alternate content.
(this answer does not rely on jQuery or other frameworks)
// on load
window.scroll(0,0);
To ensure no old content is displayed while launching I use this in my page:
window.addEventListener('unload', function() { $('body').hide(); } );
Thus the last state of the page is empty and is what is shown to the user when the page is opened again.