Phonegap 3.0 PowerManagement - ios

Is it possible to use the PowerManagement Phonegap Plugin found here https://build.phonegap.com/plugins/29 with Phonegap 3.0 on iOS6,7?
If so, is it still enough to place the following element to the config.xml?
<gap:plugin name="com.simplec.plugins.powermanagement" />
Or is there a way to install it the Phonegap 3.0 way messes up the iOS version of the app:
phonegap local plugin add https://github.com/simplec-dev/powermanagement.git
What I want to achive is, that my app runs endless and the iPhone power saver gets suppressed.
Thanks for a hint.

I'm not sure if the original author has updated the plugin to be compatible with PhoneGap 3.0 yet - but I maintain a fork of it that I have updated that should work. It lives here but you should be able to install from the CLI like this:
$ cordova plugins add https://github.com/cemerson/cordova-powermanagement.git
Also, I'm not sure how recently you've used the plugin but the syntax/usage has changed over the past months/year. I have a few helper scripts that I normally use here if you want to modify/use.
PS: Naturally if the original author has updated the plugin somewhere to be 3.0 compliant definitely use that version! Use the above only if that's not the case or you have other problems!

Cordova plugin PowerManagament for 3.0+
https://github.com/raulduran/PowerManagement

Related

Zendesk & Ionic - cordova-plugin-zendesk doesn't build for IOS

I have a hybrid app and I need to implement a Zendesk Tool there. There is a plugin that I thought that I am trying to use: https://github.com/fleetio/cordova-plugin-zendesk
The problem is that I am able to make it work on Android but on IOS the build fails with an error:
❌ /Users/ionic/builds/casasoft/jobmate-frontend/ios/capacitor-cordova-ios-plugins/sources/CordovaPluginZendesk/Zendesk.m:3:9: module 'ZendeskSDK' not found
I tried to provide the integrator using CocoaPods too according to what is written in the release notes
and I am experimenting a lot trying to change some things but unfortunately without any success.
This plugin is using Zenbox in version 3.0.1 Swift 5.1 GM: https://developer.zendesk.com/embeddables/docs/ios_support_sdk/release_notes#3.0.1-swift-5.1-gm-compatible-build
I use Ionic 5 & Capacitor. It works on Android but not on IOS.
I am completely out of ideas right now and I started to shoot in the dark but really nothing helps.
Was anyone using it on IOS before? I am trying to build with XCode 11 but even with XCode 10, the error is always the same, even with Appflow Service (Ionic product to build ios files).
What am I missing? Do you have any idea what might be wrong? Maybe it rings a bell in someone's head... Thanks in advance.
That plugin uses cordova-plugin-cocoapods-support as a dependency to configure CocoaPods dependencies instead of using the official Cordova tags.
Capacitor doesn't support those custom tags, there is an issue open for considering it, so add a +1 reaction if you are interested https://github.com/ionic-team/capacitor/issues/2773
But the ideal fix would be for the plugin authors to move to the official syntax
I tried to investigate a bit on my own. Eventually, I was able to build on IOS but I did this only as an out-of-curiosity check.
This is a sort of a workaround (with the 'official syntax' mentioned in the #jcesarmobile comment).
This is not a fully solved problem and I am not an IOS developer so I am not sure if this code makes 100% sense (but it worked).
I am just giving a hint here to everyone who may encounter a similar problem.
In the plugin.xml
1) removed this line
<dependency id="cordova-plugin-cocoapod-support" />
2) inside 'platform name="ios" remove this line:
<pod name="ZendeskSDK" version="~> 3.0.1" />
3) instead of this deleted line (from point 2) paste this:
<podspec>
<config>
<source url="https://cdn.cocoapods.org/"/>
</config>
<pods>
<pod name="ZendeskSDK" git="https://github.com/zendesk/zendesk_sdk_ios.git" branch="3.0.1-swift5.1-GM" />
</pods>
</podspec>

How to add cordova plugin in IOS cordva application?

i have cordova application in IOS.I am using x code to modifying in application. actually i am new to mac and IOS i want to know how to add custom or third party cordova plugin in my IOS application.Any tutorial or guidance any one recommend?
You use cordova, to add plugins you use:
cordova plugin add *pluginname*
in the installation process it will be added to all platforms that the plugin supports. For further information about that you have to read the readme files of the plugin. They explain that for every part of their plugins better than we can here in our short texts.
If you have any further question, just ask :) Have a nice day.
You can use the command cordova plugin add PLUGIN_NAME
Please check the documentation from Cordova for other options to update, remove, build the plugin https://cordova.apache.org/docs/en/3.1.0/guide/cli/index.html

CanvasCamera for iOS PhoneGap / Cordova

First of all, I'm really new to Cordova and Xcode and I'm trying to create an inline QR Code scanner from and HTML 5 app (or at least see if it's possible with this plugin).
I'm trying to follow the instructions from https://github.com/daraosn/Cordova-CanvasCamera and I am unsure what format or how to edit the config.xml in my project.
The instructions say:
"Edit your config.xml and add CanvasCamera into your Plugins list." but i dont know what this means or what format it should follow.
Also, when I add the plugins to the Plugin folder in the project, Xcode throws an error saying:
"'NSAutoreleasePool' is unavailable: not available in automatic reference counting mode".
I know that getUserMedia isnt support in Safari/iOS so it's pushing the boundaries a bit. If all else fails, i'll just use the input type=file and access the camera that way.
That plugin you reference looks severely dated. My best guess is, for your config.xml, add:
<plugin name="CanvasCamera" />
once you copied the files into your directory per those instructions.
Also, you could check out https://github.com/donaldp24/CanvasCameraPlugin. You can install it by running "cordova plugin add https://github.com/donaldp24/CanvasCameraPlugin.git && cordova prepare".
Hope this helps.
I found a plugin (http://scandit.com) which is much better than what i was originally trying to achieve.
The only downside is that it's a premium service ($200/month), however the upsides are: super easy to install, is really really fast at decoding (doesn't need to focus, shade doesn't matter), available on plenty for platforms, good documentation.
Another point was that it is a fullscreen camera plugin, which actually works better than inline, what we initially wanted.
Hope it helps anyone else.

IOS Phonegap 3.X: Lock page orientation during runtime

I am developing a webapp using phonegap + sencha touch, and I want to lock orientation on certain pages during runtime. I found this phonegap plugin , but it's not working for phonegap 3.X.
I also found something about a js function which named 'shouldRotateToOrientation', is it provided by phonegap? And it seems just works in multi-page(html files) app, my sencha touch app only have one html file.
So, how can I do that? Any help from you will be greatly appreciated.
i know this is not really a valid "answer" but SO doesn't let me comment with <50 rep. anyway, i noticed it's not that difficult to set up an old plugin to be used with cordova 3+. adhere to the folder structure (which you can see in existing cordova plugins like "device"), create a plugin.xml and install the plugin with plugman. read the documentation about plugin development and you should be good.
you will especially have to replace the function header in the ios files. replace
-(void)setAllowed:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
with
- (void)setAllowed:(CDVInvokedUrlCommand*)command
This is a phonegap plugin for android/ios.
https://github.com/yoik/cordova-yoik-screenorientation

PhoneGap 3.3 HideKeyboardFormAccessoryBar not working

I am using PhoneGap 3.3.0-0.19.6 and Cordova 3.3.1-0.4.2 but HideKeyboardFormAccessoryBar=true doesn't work. I checked other related questions and the solution (at least for PhoneGap 2.7) is to edit CDViewController.m (under Classes/Cleaver), but apparently this file is missing in Phonegap 3.3
Please help!
I use KeyBoard plugin to fix this problem. (I'm currently in phonegap 3.4.0)
To download it, either
Type 'cordova plugin add https://github.com/apache/cordova-plugins.git#dev:keyboard' in your project folder
Or type 'phonegap local plugin add org.apache.cordova.keyboard', and update the newest code from KeyBoard plugin.
For Further infomation, visit phonegap CB-3020 jira. (sorry, I not allow to post more than 2 links)
Good Luck!

Resources