HTML5 app + Facebook Javascript SDK = without hope?

Hi, I am aware that BB10-WebWorks-samples provides the example of Facebook-OAuth-2 for the Facebook integration in an HTML5 app.

I just confirm that it is really desperate to try to use instead of Facebook Login with Javascript SDK ? I tried to load the Javascript SDK in my HTML5 app without success.

Hi chadtatro, your sample application works and I understand your well written code. Thank you very much!

Just think about it... why the documentation for Facebook to use their Javascript SDK led to errors? What is their tutorial for work on other platforms?

Tags: BlackBerry Developers

Similar Questions

  • Build an html5 app, I only .html, .js, images, css file folder files / files. How to build a web app/html5 app in that if I did not file config.xml?

    Build an html5 app, I only .html, .js, images, css file folder files / files. How to build a web app/html5 app in that if I did not file config.xml?

    I downloaded the game codes and try to build games using these codes, but I had only

    data folder

    image folder

    js file with .js files

    file .html

    main.js file

    In this case, how build/package web app /html5 app if no config .xml given?

    You will need create your own file config.xml. There are samples and documentation on each of the items on our microsite here:
    https://developer.BlackBerry.com/HTML5/documentation/gold/working_with_config_xml_file_1866970_11.ht...

    Note that all the elements in the samples are not necessary. For each piece, make sure that you actually need in the config.xml file. For example, most web game conversions will not need elements (using the old SDK) since they make use of BlackBerry-specific APIs.

  • How to send notifications in Blacknberry html5 apps for mobile OS 7.0 Bb etc.

    How to send notifications in Blacknberry html5 apps for mobile OS 7.0 Bb etc.

    Please guide me with

    Client SDk

    SDK server-side

    IE code etc. with API

    I have app html5 appeared in the app world.

    Here's the documentation on using to push in a WebWorks for BlackBerry 7.0 application:

    https://developer.BlackBerry.com/BBOS/HTML5/APIs/BlackBerry.push.html

    For the side server, here is the SDK of Service Push documentation:

    https://developer.BlackBerry.com/DevZone/develop/platform_services/push_service_sdk.html

    However, I advise to use a service like the urban airship for your management side push server.  They have asked all the pieces of the puzzle, and you can create a new account and send messages push through this service.

  • Why can't I access apps.facebook?

    I played the island treasure on Facebook, it's a game from Zynga.  Since yesterday it is not able to find apps.facebook.com

    Hi linda tote,

    1. did you of recent changes on the computer?

    2 are you able to access other Web sites on the computer?

    3. what web browser do you use to access facebook?

    You need check facebook settings allow access to the application.

    I suggest that you reset the Internet settings explore by default and check if it works.

    For more information please visit the link below.

    How to reset Internet Explorer settings

    http://support.Microsoft.com/kb/923737

    Important: Reset Internet explore its default configuration. This step will disable also any add-ons, plug-ins or toolbars that are installed. Although this solution is fast, it also means that, if you want to use one of these modules in the future, they must be reinstalled.

  • How to test a 'Bundled' HTML5 App

    I packed my HTML5 app using ripple. The result is a single compressed file which seems to contain all my files in the application. Now, I want to run my application on a Simulator or a load on hardware real blackberry for testing. I don't know how to do this.   But looking at the contents of the zipped file ripple created, that would be different from putting the program on a server and paste the url into ripple for simulation?

    I'm confused because the ripple does not create a file system, for example a file .cod in the case of java applications.

    Instead, it is just to create a zipped file containing all my files in the application. How can I test this? How can I see exactly how the application might behave on a blackberry?

    Note to staff BB Dev, the documents here https://bdsc.webapps.blackberry.com/html5/documentation/ww_testing/loading_your_app_on_a_smartphone _...

    seem to be to test a java application on a blackberry. However, they are in the section of your Web sites that provides instructions on how to build and test applications HTML5.

    It seems that this was my mistake. The packaging process produced a few records cod DIF and other system files.

  • Facebook Blackberry SDK; cannot update status or post it on the wall

    Good afternoon!

    I downloaded the most current Facebook-bb-sdk from SourceForge, but can't make it work.

    It seems to be ok sign, but I can't get any action edition in order to work. I installed the JARS as indicated in the readme.pdf, but the version that I downloaded does not include the sample application Strawberry and there seems to be no other downloads available. I, however, managed to find a project obsolete Stawberry, but it did not help (too old, maybe).

    In any case... Here is the code relavent which is attached to a button action:

    String NEXT_URL = "http://www.facebook.com/connect/login_success.html"; // also tried http://m.facebook.com/login.php
    String APPLICATION_ID = "my-application-id-is-here";
    String APPLICATION_SECRET = " my-secret-decoder-ring-code-is-here";
    String[] PERMISSIONS = Facebook.Permissions.USER_DATA_PERMISSIONS;
    ApplicationSettings as = new ApplicationSettings(NEXT_URL, APPLICATION_ID, APPLICATION_SECRET, PERMISSIONS);
    Facebook fb = Facebook.getInstance(as);
    
    try {
    
       User user = fb.getCurrentUser();
       Dialog.inform("FB Name:" + user.getFirstName()); // this does indeed give me the correct authenticated user
       user.publishStatus("Hello world!"); // this does not publish my status update. boo
    
    } catch (FacebookException e1) {
    
        e1.printStackTrace();
        Dialog.inform(e1.toString());
    }
    

    As mentioned, login pages happens, I connect... and then I expect my status update to happen, but it never appears on my FB page. If I hit the button again, no login page shows (of course because I'm already authenticated), but no position shows no more. The dialog box I have arise watch the right user. I'm out of ideas.

    Any help is VERY appreciated. Thank you!

    Welcome to the forums!

    To start, you receive an exception when you try to post a new status? What a stack trace in your console?

  • Volumes of the App can be used without Horizon?

    Volumes of the app can be used without Horizon? It seems to be a case of using these features, not only for desktop computers. Say for R & D working with quick auto tests departments deploying the latest versions etc. Can a unique environment of vSphere be used? If so, these deployment tasks can be controlled by a PLC?

    Yes, and with other brokers. Volumes of app is also sold as a stand-alone product.

    More info in the FAQ.

    http://www.VMware.com/files/PDF/appvolumes/VMware-appvolumes-FAQ.PDF

  • Javascript SDK using place the Facebook wall on site

    I am new to trying to integrate Facebook with Web sites.  I can do Twitter without problem, but Facebook raises questions.  I've went to the Facebook Developer area and generated code to place a Facebook wall on the site of a friend.  However, it does not, nor does the button I like.  What follows, I placed it in Dreamweaver:

    < body > < div id = 'fb-root' > < / div >

    < script > (function (d, s, id) {})

    var js, SJF = d.getElementsByTagName (s) [0];

    If (d.getElementById (id)) return;

    js = d.createElement (s); js.ID = id;

    js. SRC = "//connect.facebook.net/en_US/sdk.js#xfbml=1 & version = v2.3;

    fjs.parentNode.insertBefore (js, SJF);

    (} (document, 'script', 'facebook-jssdk')); < /script > < / script >

    And for the plugin:

    " < div class ="fb-page"data-href = ' https://www.Facebook.com/pages/far-from-the-madding-crowd-Linlithgow/413384208733342 "data-width ="350"data-height ="500"data-hiding-cover = 'false' data-show-facepile = 'false' data-show-post ="true"> < div class ="fb-xfbml-analysis-ignore"" > < blockquote cite = " https://www.Facebook.com/pages/Far-from-the-Madding-Crowd-Linlithgow/413384208733342 " > < a href = " https://www.Facebook.com/pages/Far-from-the-Madding-Crowd-Linlithgow/413384208733342 " > far from the Madding Crowd Linlithgow < /a > < / blockquote > < / div > < / div > ""

    On the developer page on Facebook, the wall displays fine with the above code, but when I put the code in Dreamweaver CS5 (using Yosemite OSX), it only shows the name of the company as a hyperlink.  No messages.

    The same goes for if I try to put the code for the button I button to follow.

    I have been searching google for hours, but can not solve this problem.  Any help would be greatly appreciated.

    Have you tested this in a browser or on a website online?

    In the script, there is the following line:

    var js, SJF = d.getElementsByTagName (s) [0];

    It declares two variables JavaScript. The value assigned to the second is d.getElementsByTagName (s) [0]. The last line of the script assigns "script" as value of s. In other words, it is looking for the first script on the page. If you have script blocks in the header of the document, it will choose that badly.

  • app crashing using javascript SDK 6.0 browserfield2

    Hi all!

    I have my app allmost crashed every time I call the javascript in browserfield to scroll the text in there. Sometimes this only works when javascript is called the first time.

    SDK 6.0

    device also has 6.0 sdk

    class MyBrowserFieldView extends screen implements {RenderingApplication}

    RenderingSession renderingSession;

    BrowserField browserField;

    VerticalFieldManager verticalFieldManager;

    public MyBrowserFieldView() {}

    ToolBarMenuButton.AddMenuItem (New MenuItem ("show", 100, 1)})
    public void run() {}
    browserField.executeScript ("document.body.scrollTop ='" + position + ""; "");
    }
    });

    renderingSession = RenderingSession.getNewInstance ();

    renderingSession.getRenderingOptions () .setProperty (RenderingOptions.CORE_OPTIONS_GUID,
    (RenderingOptions.JAVASCRIPT_ENABLED, true);
    renderingSession.getRenderingOptions () .setProperty (RenderingOptions.CORE_OPTIONS_GUID,
    RenderingOptions.CSS_MEDIA_TYPE, "screen");
    renderingSession.getRenderingOptions () .setProperty (RenderingOptions.CORE_OPTIONS_GUID,
    (RenderingOptions.ENABLE_CSS, true);

    browserField = new BrowserField();

    verticalFieldManager = new MyManager();

    try {}
    browserField.requestContent (HtmlFileName);
    verticalFieldManager.add (browserField);
    Add (verticalFieldManager);
    } catch (Exception ex) {}
    ex.printStackTrace ();
    }

    }

    }

    So, what can be wrong?

    Thanks for any help!

    Yes, using another thread has helped. Thanks again!

  • HTML5 App - See the pop-up message window when in the background

    Hello

    I need my application to display a popup to the user even if the application is in the background.

    How can I do this if my application is built with html5 and JavaScript?

    Thanks for any help

    Hello Wadi,

    This has proved to be a bit of a monster post. If you have any questions at a stage any post, do not hesitate to ask. Let's dive.

    There are a few issues I see with the code you provided.

    PopupExtension.java


    • Creates an AlertNamespace object, your class is called PopupNamespace.

    PopupNamespace.java


    • getField is not implemented. \

    PopupFunction.java


    • A lot of import declarations are missing.

    I'll show you a comparison of my files, I managed to get the dialog box displayed from in my WebWorks app; No matter whether the application is in the foreground or background.

    For reference, the creation of my java files is based on the examples of code available here:

    https://bdsc.webapps.BlackBerry.com/HTML5/documentation/ww_developing/using_javascript_extensions_18...

    For starters, I have SandboxExtension.java. It is the equivalent of your PopupExtension.java.

    package sandbox.extension; 
    
    import net.rim.device.api.browser.field2.BrowserField;
    import net.rim.device.api.script.ScriptEngine;
    import net.rim.device.api.web.WidgetConfig;
    import net.rim.device.api.web.WidgetExtension;
    import org.w3c.dom.Document;
    
    public final class SandboxExtension implements WidgetExtension {
        String _widgetNameForFutureUse;
        BrowserField _browserFieldForFutureUse;
    
        public String[] getFeatureList() {
            String[] result = new String[1];
            result[0] = "sandbox.popup";
            return result;
        }
    
        public void loadFeature(String feature, String version, Document doc, ScriptEngine scriptEngine) throws Exception {
            if (feature.equals("sandbox.popup")) {
                scriptEngine.addExtension("sandbox.popup", new SandboxScriptable());
            }
        }
    
        public void register(WidgetConfig widgetConfig, BrowserField browserField) {
            _widgetNameForFutureUse = widgetConfig.getName();
            _browserFieldForFutureUse = browserField;
        }
    
        public void unloadFeatures(Document doc) {
        }
    }
    

    Main differences


    • I've updated my package to sandbox.extension it is unique (less chance that it has already been used.)
    • In getFeatureList, I and by using the function sandbox.popup; It was purely a personal choice I made during the implementation of the example. There is no real functional difference.
    • Subsequently to the first point, I also refer to sandbox.popup in my remaining code; more precisely within loadFeature.
    • My method of register sets two corresponding member variables.
    • I create a new SandboxScriptable object as opposed to your object of AlertNameSpace.

    The following file is SandboxScriptable.java. It is the equivalent of your PopupNamespace.java file. Note that this class must refer to the object that is created in the file above. In my case, I created an object of SandboxScriptable , so I'm now implement SandboxScriptable.java to define this object.

    package sandbox.extension;
    
    import net.rim.device.api.script.Scriptable;
    
    public final class SandboxScriptable extends Scriptable {
    
        private SandboxPopup _sandbox;
    
        public SandboxScriptable() {
            _sandbox = new SandboxPopup();
        }
    
        public Object getField(String name) throws Exception {
            if(name.equals("doPopup")) {
                return this._sandbox;
            }
            return super.getField(name);
        }
    }
    

    Main differences


    • Slight changes to naming to accommodate my variable names.
    • The getField function is (and must) be implemented. In fact, when a method is called, I check to see if it is the doPopup method. If so, I returns a SandboxPopup object. This would be your PopupFunction class. If the user does not call the doPopup method, I just pass back the default behavior via the super object.

    The final class is SandboxPopup.java. It is the equivalent of your PopupFunction.java. Above, we create and return an object of SandboxPopup , so in this file that we actually apply this that the object is actually.

    package sandbox.extension;
    
    import net.rim.device.api.script.ScriptableFunction;
    import net.rim.device.api.system.Application;
    import net.rim.device.api.ui.UiEngine;
    import net.rim.device.api.ui.Ui;
    import net.rim.device.api.ui.Screen;
    import net.rim.device.api.ui.component.Dialog;
    import net.rim.device.api.system.Bitmap;
    import net.rim.device.api.ui.Manager;
    
    public final class SandboxPopup extends ScriptableFunction {
        public Object invoke(Object obj, Object[] args) throws Exception {
            synchronized(Application.getEventLock()) {
                UiEngine ui = Ui.getUiEngine();
                Screen screen = new Dialog(Dialog.D_OK, "Hello World!", Dialog.OK, Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION), Manager.VERTICAL_SCROLL);
                ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_QUEUE);
            }
            return "UNDEFINED";
        }
    }
    

    Main differences

    • I added all declarations of import for the different Classes of the RIM used.
    • I return a default value 'Not DEFINED' string regardless of the success.

    And that is the essence of the java files. Basically, it is a string of three classes; the first refers to the second, and the second refers to the third. In your example, the chain is slightly broken, however can be fixed fairly quickly based on the notes above.

    The next part that needs to be done is to associate your Javascript Extension with WebWorks. This can be done in two different ways.

    • Package your extension with your application. Described in the Javascript Extension guide link above.
    • Integrate your extension with your SDK WebWorks.

    I opted for the latter, I find this approach a little simpler. The first thing we need to do is to copy our java files in the extension folder. The extension root folder that I used is as follows:

    C:\Program search in Motion\BlackBerry 2.3.0.9\ext\ SDK WebWorks

    In this case, I created a folder sandbox.extension to House my extension:

    C:\Program search in Motion\BlackBerry 2.3.0.9\ext\sandbox.extension SDK WebWorks

    I then copied the folder src housing my files java to get the following file structure:

    Note that the CBC/sandbox sand/extension path is no coincidence because sandbox/extension's folder as dictated by the package structure that I used in my java files. More precisely:

    package sandbox.extension;

    The last thing missing is a library.xml file. I used the library.xml files available on Github WebWorks community API page as a starting point and made a few modifications for the following.

    
        
            sandbox.extension.SandboxExtension
        
        
            
                
            
        
        
            
                
            
        
        
            
        
    
    

    Key information

    • The is set to point to the class that implements WidgetExtension. In this chain of three java files, it would be the first file.
    • Under , I set path = 'src' since the real package begins in the src subfolder.
    • Under I've set the id to sandbox.popup.

    This file has been created under the sandbox.extension root folder, specifically:

    C:\Program search in Motion\BlackBerry 2.3.0.9\ext\sandbox.extension SDK WebWorks

    And that's all for the configuration of the SDK. Now, when I have an application that relies on this extension, I don't no need to include something more in my real application because this feature is now integrated directly with my SDK. To use this feature, I need to:

    • Include the feature in my file config.xml .
    • Call the function in my Javascript.

    My file config.xml looks like as follows.

    
    http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="1.0.0">
        Sandbox
        Oros
        
    
        
    
    

    Very basic. The element indicates index.html will be our main entry point. The important thing here is that I have included the item with id = "sandbox.popup". " You will notice that it is the same id that we have defined in library.xml.

    Finally, here is a small sample application that gives the user a button. Once this button is clicked, a timer is called during 5 seconds. At the end of those 5 seconds, the extension (and in turn a popup dialogue) is called.

    
    
        
        
        
            
    
            
        
    
    

    As you can see, we add a to our page which, when clicked, will trigger the function of fire . The function of fire calls setTimeout with a founter of 5000 milliseconds.

    The reason for this is to give you the opportunity to stay within the application, or limit its application with the red end call button. No matter whether you are in the application or the application is reduced, after 5000 milliseconds, the invokeExtension function is called.

    In invokeExtension, you can see call us sandbox.popup.doPopup. sandbox. Popup is the object, we defined in library.xml and put subsequenty implement within our java files. doPopup is the function we defined to be processed in the java files.

    Still, if you have any questions about the foregoing, please let me know.

    Erik Oros

    BlackBerry Development Advisor

  • Persistent BlackBerry Smartphones 2010 when unknown error uploading photos from the app Facebook of RIM

    Judging by the comments in AppWorld, it looks like last update of the Facebook #RIM for #Blackberry broken upload photo. After reading a few threads here, I tried pulling the battery, delete - reinstall the app, take smaller pictures, removing information geo-tagging and checking permissions. I always get an unknown error 2010.

    I can download to send an email and Twitter without any problem.

    I hope this gets fixed soon. It seems that there are a lot of people out there with this problem.

    Nothing here that could help you?

    Article ID: KB25378 Error codes on the set of the 2000 Facebook Facebook for BlackBerry smartphones

    Article ID: KB25889 Error "there was an error in this load a photo" when you try to upload a photo using Facebook for BlackBerry

  • Play HTML5 video with JavaScript does not hide the overlay dimming video

    I googled this problem and found nothing useful and also checked the area of support here and still nothing. I'm creating a webpage with HTML5 video. I made a layer with the video object that is hidden with CSS, until the user clicks on a link. When the user clicks on the link, I use a JavaScript function to display and play the HTML5 video object. Works fine except that Firefox keeps the overlay in place play button while playing my video! If I click on the overlay, the video stops. Then if I click again, the overlay disappears and the video resumes playback.

    I realize there are solutions that can be pirated. But it is certainly a bug that the rest overlay in place after the start of the video via a JavaScript command. I hope that this problem finds its way to the right people at Mozilla for resolution.

    Thank you
    -DK

    Can you please update to Firefox 18.0.1 and see if the problem exists in a new profile? (13 is no longer supported)

    Use the Profile Manager to create and delete profiles Firefox

    If this happens again please give an example of site Web with the show and the screenshots of what should happen compared to what's going on

  • BlackBerry App Facebook app problems

    Please I need help with my facebook app. He won't open and I can't even install it it BlackBerry world either. What would I do?

    Topic title edited to reflect the new topic.

    jolly2015

    Wink is primarily intended to connect to the Google game shop, so you can install the apk android on your Blackberry device files, so we do not use wink in this case...

    You'd have to use is Knowyou, if you are not familiar with its use, check:

    http://supportforums.BlackBerry.com/T5/BlackBerry-10-OS-device-software/upgrading-BB10-OS-using-Sach...

    In fact, you can skip the part about choosing which of the alternatives to use for this process, since we don't ask knowyou to extract the source files online.

    Here's what you need to do:

    Download the bar to produce for the purposes of facebook from your computer, using the link below:

    http://CDN.fs.SL.BlackBerry.com/FS/QNX/production/b09d41cf7bee2031431998e2c316fb775f0ef589/Facebook-...

    Download Knowyou on your computer (download link)

    https://github.com/xsacha/Sachesi/releases/download/2.0.0RC/Sachesi2-RC-Windows.zip

    Set your system offline (it disconnect from internet)

    Connect your BlackBerry smartphone to your computer (if the Blackberry link auto lance, close it)

    Launch Knowyou (if you have a password set for your device, would be asked and you will need to enter it and knowyou should automatically detect your device type.)

    Click the install from knowyou interface, click on setup file and place where the .bar facebook has been saved, click it and let knowyou do its magic (you can also use drag and drop once you are on the installation interface)

    Once Knowyou is done, you can restart your device (although not a necessity, but I prefer it like that).

    If there are errors, please come back to the forum and let us know... If it's not and you get successfully return facebook app, also share your experience.

    Once installed and your device has been restarted/rebooted, you can rely on Blackberry App World to check an update of the facebook app

    Hope this helps

  • Box + app.alert JavaScript

    Adobe scripting,

    Currently have a checkbox with the current race a JavaScript code

    App.Alert ("Text here", 1);

    This works very well, but... also alerts when the checkbox is clicked off again...

    Is it possible to have only the alert pop once when checked and when you click on it again the alert is not pop.

    Also if possilbe (im Hope does not much) is it possible to have a text of the hyperlink on the 3rd line looking for something like that.

    warning.JPG

    Thanks in advance!

    Steve.

    In the MouseUp event of the checkbox, do something like:

    If (event.target.value! == 'Off') {}

    App.Alert ("Hello", 1);

    }

    There is no way to include a hyperlink in an app.alert, but you can configure an app.alert have Yes, no, Cancel buttons. If you ask the user the question: "Would you like to go here," they might click on Yes and then you could run a statement that implements the hypertext link.

    You can also be more flexible if you use a custom dialog box that includes a button that implements the hyperlink, as demonstrated in the second example page two here: http://www.windjack.com/resources/Examples/DialogUses.pdf

  • Is it possible to load podcasts (using podcasts app) on the iPhone without the need to have these load on iTunes on Mac at the same time?

    I agree, download and listen to podcasts on my iPhone (6 s 9.3.4).) When I sync with my Mac (2008 Macbook OS Lion) it also syncs podcasts (obviously) but it takes too much space on my Mac, and I never listen to the podcasts on the Mac. When I uncheck the sync option of podcasts in iTunes (12.2.2.25), he said that it will remove all the podcasts on the iPhone too, that I don't want. Is it possible to download podcasts over the phone without also their sync iTunes as well?

    Thank you

    The Podcast app works using the connection of the iPhone and can sync no read using iCloud. Can simply browse podcasts and download them directly from the phone.

    This article of support could help: about Podcasts app - Apple Support

Maybe you are looking for