1 Reply Latest reply on Mar 22, 2016 6:42 PM by Chris W. Griffith

    Nrebie needs help

    ianhowse Level 1

      Hi,

      I have been using PhoneGap to test an App I am developing - all in javascript and HTML5.

      All's good as long as I using 'raw' HTML, DOM, Google Maps, etc but I now want to take advantage of PhoneGap native code and am having trouble getting any result.

      I `think` I have set up the config.xml file and index.js correctly (pretty much as distributed) and thought I would start with a simple ...
        navigator.notification.confirm(
        'You are the winner!', // message
        onConfirm, // callback to invoke with index of button pressed
        'Game Over', // title
        ['Restart','Exit'] // buttonLabels
        );
      but absolutely nothing happens!

      I have verified `function onDeviceReady()` is firing - by inserting an alert('ready').

      I have added the following lines to the config.xml file ...

      <platform name="ios">

        <allow-intent href="itms:*"/>

        <allow-intent href="itms-apps:*"/>

        <feature name="Notification">

        <param name="ios-package" value="CDVNotification" />

        </feature>

        </platform>

      I have the following lines in my .html file ...
      <script type="text/javascript" charset="utf-8" src="index.js"></script>
      <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
      <script type="text/javascript" charset="utf-8" src="cordova_plugins.js"></script>

      What have I forgotten?

        • 1. Re: Nrebie needs help
          Chris W. Griffith Adobe Community Professional

          Couple of things. You need to make sure that you install the Dialogs plugin into your project. You do this through the CLI:

           

          phonegap plugin add cordova-plugin-dialogs

           

          Once you have the plugin installed your code will work: I assume you have read - cordova-plugin-dialogs - Apache Cordova

           

          I don't think you need to include this

           

           

          <feature name="Notification">

            <param name="ios-package" value="CDVNotification" />

            </feature>


          in your config.xml. It might be auto added and managed by the CLI.


          I also recommend loading cordova and related js files before any app files.


          Chris