Zendesk & Ionic - cordova-plugin-zendesk doesn't build for IOS - 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>

Related

Lexical or preprocessor issue in react native while building ios app <React/RCTUtils.h> not found

When I am trying to build my ios app in xcode, the build is failing due to lexical or preprocessor issue the error shows up like this
This was a problem specific to the react-native-device-info module.
For your specific case you may try v1.6.1 or higher (currently at 2.0 as of May 21, 2019) of the library and that should fix things for you.
For others interested more generally in the problem, this is a react-native library that uses native code, so it has an XCode project embedded within it for use in react-native after you run react-native link react-native-device-info. Unfortunately, the library was not including any directories in it's header search path, so it was of course unable to find the header files for the react-native objects it was using locally.
A library user proposed a change that fixed that problem for tvOS, and I extended the change to cover iOS as well, and now the library no longer generates errors like this for iOS or tvOS targets.
Perhaps someone with a similar issue may find the specific changes required for the fix useful in their projects

Cordova deprecated when using Ionic Framework for SocialSharing ng-Cordova plugin

When I run my app in xcode, it advises me there are 2 errors:
"dataFromBase64String:base64content" is deprecated
suggests added cdv to create "cdv_dataFromBase64String:base64content"
The error in the browser console is clearly:
Cannot read property 'socialsharing' of undefined.
Not sure if this is a fix I can go in and manually do somehow? Or if I need to abandon this plugin.
Direction or advise would be greatly appreciated. Or alternative plugins that work natively to use with Ionic.

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.0 PowerManagement

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

Resources