Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Adding permissions to PhoneGap

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Adding permissions to PhoneGap

    I am embedding video into a PhoneGap app and the content will not display though it does in the web version. I posted on the PhoneGap Build forum and got the following reply (This is partial and I added the bold):

    > This relatively * NEW * requirement means � to access ANY website or resources on the web, you MUST use the whitelist and the whitelist plugin. This requirement goes into affect if you are using [email protected] or better; including cli-5.1.1. If however, your version is before 4.0.0, let use say 3.5.0 or 3.7.0, then you will *not* have to add the *white-list* requirement.

    > To be clear, the "whitelist" has been around for a bit, but the plugin and requirement is very new. As you would expect, when the "whitelist" was added, the defacto open-access feature was deprecated. Or said another way, the defacto open-access feature was planned and scheduled to be eliminated. This change marks a step in removal of the open-access feature
    The full forum thread is here:
    http://community.phonegap.com/nitobi...y_button&reply[id]=16166361#reply_16166361

    Can we add plugins/permissions that are not listed in the Alpha PhoneGap project settings? If not, is there another way anyone can think of to embed video from another site.

    #2
    Re: Adding permissions to PhoneGap

    You can add anything you like to the PGB config.xml file that Alpha creates for you. When you're finished with the Builder, click Save instead of Submit. This will open a Confirmation dialog which contains a link labelled "Click here to see the PhoneGap Build XML configuration file". Well... not only can you see it... you can edit it. And... you're edits stick. Bob has made all of this really nice to work with.

    Comment


      #3
      Re: Adding permissions to PhoneGap

      David, thanks. It is very good to see where we access the .xml file. But..... I think I just broke my app doing it. This is the first time I have ever worked with a .xml file and I added some suggested whitelist code and got a build error for malformed xml file. No biggie, could tinker and see what works, but now I can not even open the phonegap builder. It is throwing the following error:

      Property not found
      v2.widget.access.origin subelement not found.

      I fear I have lost the ability to access the phonegap builder for this project forever.

      Comment


        #4
        Re: Adding permissions to PhoneGap

        Something is probably just out of whack. Zip and post the config.xml here... I'll fix it up for you and let you know what was wrong with it.

        You haven't lost anything... don't worry.

        Comment


          #5
          Re: Adding permissions to PhoneGap

          David, Sure appreciate your taking a peak. I got the config.xml file attached from the folder as I can not access the builder.
          Attached Files

          Comment


            #6
            Re: Adding permissions to PhoneGap

            Hey Eric,

            I put your config file into one of my PGB projects and then opened the Alpha PGB Builder. It opens without error. I also edit the config.xml file directly and couldn't see anything wrong with it.

            Try this. Shut down Alpha. Then edit the config.xml file with Notepad++ or something. Remove the access origin line. The config.xml file is just a text file.

            Also... you can try this. In your Project's PhoneGapProjects folder - where the config.xml file is located - rename the config.xml file to config_bad.xml. Fire up Alpha again and open the PGB Builder. A new config file will be created for you.

            What build and add-in version of Alpha are you using?

            Comment


              #7
              Re: Adding permissions to PhoneGap

              David, I tried the renaming the config.xml file and reopening AA and the app. Still getting the same error. It looks like it can not find a resource PG builder needs.

              Oh, and the build is 3063 and addins is 4534.
              Last edited by ecalan; 09-28-2015, 10:51 PM.

              Comment


                #8
                Re: Adding permissions to PhoneGap

                I don't have 3063 any longer... but I just tried with 3065 and with the latest pre-release... and it's ok.

                Try this next. In the PhoneGapProjects folder you'll find the folder for your app. Rename the whole folder. Let the builder create a new folder and files.

                Comment


                  #9
                  Re: Adding permissions to PhoneGap

                  Hey David, great, renaming the folder worked and the builder is opening with a blank slate. Perfect. I am going to try again to add to the config.xml to get the facebook videos to display. Any suggestions on that one?

                  Comment


                    #10
                    Re: Adding permissions to PhoneGap

                    In looking at the config.xml file closer, I see that it already has in it by default: <access origin="*" /> which, if I am reading the whitelist info at https://github.com/apache/cordova-plugin-whitelist correctly should allow all requests. I have also added a content security policy tag in the header as directed to also allow all requests. The facebook videos display properly on a mobile device when a url is opened directly but I am beginning to suspect that getting them to work inside phonegap will not be simple. If you have never worked with them before, embedded FB vids are completely different than say YouTube embeds which are just iframes. FB uses scripted call backs to parse the request and, for example, has to be re-parsed every time the screen is re-sized or the orientation changes - all of which I was able to successfully do prior to beginning the phonegap process.

                    BTW, thanks for the bailout on the builder error.
                    Last edited by ecalan; 09-29-2015, 12:40 AM.

                    Comment


                      #11
                      Re: Adding permissions to PhoneGap

                      Glad it worked out. I'll have a look at FB videos. You are including the actual whitelist plugin in config.xml... is that right?

                      Comment


                        #12
                        Re: Adding permissions to PhoneGap

                        Eric,

                        Could you post a simple UX attempting to access a FB video? That way I can work with and see exactly the code you're using instead of creating something new that doesn't match what you have going on. If you don't want to post it here, send me a PM.

                        Comment


                          #13
                          Re: Adding permissions to PhoneGap

                          Here is a very simple UX with one FB embed code in a static text control. It also has the parsing code in the head tags. One button re-runs the parse if needed. My actual component is fairly complicated. The embed code is dynamically generated in the sql of a list control and the videos are displayed depending on list filtering. I will send you a link to view the working web version by PM. However, if even one embedded FB vid can display in phonegap, I am sure they all will.

                          I am not sure what you mean by "You are including the actual whitelist plugin in config.xml." In the documentation linked above, it appears that all that is needed for the plugin is the appropriate <access....> language. Keep in mind, I am way new to phonegap, plugins etc.
                          Attached Files
                          Last edited by ecalan; 09-29-2015, 04:31 PM.

                          Comment


                            #14
                            Re: Adding permissions to PhoneGap

                            I got as far as this error message...

                            Code:
                            Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings.  It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
                            This led to a ton of posts about changing settings in the Facebook Apps section.

                            This is one of those holes... you start to dig and in no time you're buried in a large hole with a new error every time you try something.

                            This is the code I'm loading... note the all.js stuff and http://. The javascript library is being loaded, but now it's a case of the above error.

                            Code:
                            <div id="fb-root"></div>
                            <script>(function(d, s, id) {
                              var js, fjs = d.getElementsByTagName(s)[0];
                              if (d.getElementById(id)) return;
                              js = d.createElement(s); js.id = id;
                              js.src = "http://connect.facebook.net/en_US/all.js#xfbml=1&version=v2.4&appId=1610178672535628";
                              fjs.parentNode.insertBefore(js, fjs);
                            }(document, 'script', 'facebook-jssdk'));</script>
                            Maybe it's localhost testing that is creating an issue. I haven't tried this from a real site. I don't think the whitelist stuff is an issue. There is also a warning about the Content-Security-Policy not being set... or not being set correctly... but from what I can see you can never, ever set it correctly. The errors from CSP give suggestions as to what to include which never work.

                            It's all a mess of App Domains and Website URLs... none of which apply because we're dealing with a PhoneGap Build HTML5 app.

                            Comment


                              #15
                              Re: Adding permissions to PhoneGap

                              Are you getting that error running a phonegap app off your localhost with the simple UX I attached?

                              Comment

                              Working...
                              X