signalpoint / DrupalGap

An application development kit for Drupal websites.
https://www.drupalgap.org
GNU General Public License v2.0
232 stars 186 forks source link

Not connection on iOS #699

Open rpayanm opened 8 years ago

rpayanm commented 8 years ago

Hello: I'm working on an app for Android and iOS, have these installed plugins:

cordova-plugin-console
cordova-plugin-device
cordova-plugin-dialogs
cordova-plugin-file
cordova-plugin-google-analytics
cordova-plugin-inappbrowser
cordova-plugin-network-information
cordova-plugin-whitelist
phonegap-plugin-push
org.apache.cordova.statusbar // Only for iOS

When I compile the app for Android everything it works fine, but when I do I generate for iOS and the .ipa I get: selection_046 In both the emulator and on iOS devices (iPhone, iPad, etc).

To generate the .ipa in Xcode 7.2 and follow these steps:

--- Install Xcode v7 or higher. --- Install NodeJS https://nodejs.org/en/ --- Run in terminal: sudo npm install -g cordova --- In terminal:

$ cordova create MyApp com.myapp "My App"
$ cd MyApp
$ cordova platform add ios
$ cordova plugin add cordova-plugin-console cordova-plugin-device cordova-plugin-dialogs cordova-plugin-file cordova-plugin-inappbrowser cordova-plugin-network-information phonegap-plugin-push cordova-plugin-google-analytics org.apache.cordova.statusbar

--- Replace the www folder with my code. In index.html I add: <script type="text/javascript" src="cordova.js"></script> and set drupalgap.settings.mode = 'web-app'; in settings.js

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.myapp" version="0.3.6" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>My App</name>
    <description>
        My App description.
    </description>
    <author email="contact@myapp.com" href="http://myapp.com">
        Contact
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon src="icon.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <icon src="icon.png" />
        <preference name="StatusBarOverlaysWebView" value="true"/>
        <preference name="StatusBarBackgroundColor" value="#000000"/>
        <preference name="StatusBarStyle" value="blacktranslucent" />
    </platform>
</widget>

--- I run in terminal: $ cordova build --- I run the .xcodeproj file on MyApp/platform/ios/ --- I follow this steps: http://virteom.com/how-to-create-an-ipa-file-using-xcode

What am I doing wrong?

Thank you

signalpoint commented 8 years ago

@rpayanm Do you mean you set the mode to phonegap in the settings.js file?

Are you using cordova save plugin after adding the plugins? You have to use that now so it properly rebuilds the app. Then in xCode I go to project -> clean, and then relaunch it from xCode to make sure all the new code is pulled in.

rpayanm commented 8 years ago

@rpayanm Do you mean you set the mode to phonegap in the settings.js file?

Yes, sorry, the issue I made a mistake I set the mode to phonegap in the settings.js file, like this:

// DrupalGap Mode (defaults to 'web-app')
//  'web-app' - use this mode to build a web application for a browser window
//  'phonegap' - use this mode to build a mobile application with phonegap
//drupalgap.settings.mode = 'web-app';
drupalgap.settings.mode = 'phonegap';

Already I managed to work and without doing anything. The issue occurs in the iphone 6, on the other devices it runs fine.

jomarocas commented 8 years ago

@rpayanm normally this errors was from phonegap and not for drupalgap, try to post this in forums of phonegap, probably also i read each update of ios have problems