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

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.

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>

iOS - Realm for react-native ,unkonw execution context,

it show 'unkonw execution context' when I
import Realm from 'realm';
The same problem -> the link
how to solve it in xcode and why .
Please ensure you're using the installation/setup steps for React Native that can be found here. If you're still experiencing problems after following those steps (and I recommend trying again to see if it had to do with that project), try reinstalling React Native.
Let me know if you have any issues with this and I'll happily work with you to resolve the issue and edit my answer. Cheers!
update the react-native over 0.43 if use the newest realm.
By the way, you should update your cocoapod over 1.2.0 best that version 1.1 will link project wrong.

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

UserVoice integration in an Phonegap application

I have this iOS Phonegap application and I need to integrate UserVoice. I follow this tutorial and I have reached to the point I have to make the configuration. I am really not sure where I have to put that object UserVoice are providing me with:
UVConfig *config = [UVConfig configWithSite:#"YOUR_USERVOICE_URL"
andKey:#"YOUR_KEY"
andSecret:#"YOUR_SECRET",
andSSOToken:#"SOME_BIG_LONG_SSO_TOKEN"];
I'll appreciate some help with that, since I'm really on a beginner level with iOS apps in general. Thanks in advance.
The code you posted comes from the UserVoice for iOS SDK which gives you the libraries and code necessary to include UserVoice in a native iOS app and will not work with a PhoneGap app.
Your options are to write a PhoneGap plugin, in Obj-C, to expose the UserVoice library, or possibly a better option is simply to open your UserVoice page within your PhoneGap app using the InAppBrowser plugin.
Here is a simple phonegap plugin
http://developerextensions.com/index.php/cordova-phonegap-plugin-uservoice
I took the code from here: http://developerextensions.com/index.php/cordova-phonegap-plugin-uservoice and followed their instructions.
There were some additional things I needed to do:
edit the config.xml and add the feature UserVoiceCommand
edit the .js file and replace Ext.emptyFn with function(){}:
cordova.exec(function(){}, function(){}, "UserVoiceCommand", "launch", [config]);
(those are the success and failure callback, which I intend to implement as well)
Since it was not functioning correctly on iOS7, I cloned https://github.com/uservoice/uservoice-ios-sdk, compiled it by running ./build.sh and then overwritten the files that came with the plugin.
You can now get iOS+Android support from this new cordova plugin:
https://github.com/Resgrid/cordova-plugins-uservoice
P.S. I am not affiliated to this plugin by any means, just came across it.

sharekit for cordova 2.2.0

I am new to iOS development with phonegap,
im trying to use the sharekit plugin, i followed all the steps mentioned in the Readme (sharekit 2.0), but it is still not working, I have receive following 3 errors:
/..path../Plugins/ShareKitPlugin.m:31:63: Use of undeclared identifier 'SHKURLContentTypeWebpage'
/..path../Plugins/ShareKitPlugin.m:85:63: Use of undeclared identifier 'SHKURLContentTypeWebpage'
/..path../Plugins/ShareKitPlugin.m:102:63: Use of undeclared identifier 'SHKURLContentTypeWebpage'
The problem is that i can't find any sharekit working properly for cordova 2.2.0, as I conclude that the old version of this plugins doesn't support the new cordova 2.2.0.
any suggestion to get the latest plugin? or How to fix these errors?
I had the same problem using phonegap 2.7.0 and the latest sharekit and sharekitplugin from the repo. Add this line below the import statement. It compiles and the plugin works for me. I don't know for sure if this is right though.
#import "SHKMail.h"// Add below this statement
char *SHKURLContentTypeWebpage="text/html";
The plugin has not been updated for 2 years so this is probably an incompatibility with the new Sharekit.
Did not get these errors myself. But just a quick tip. Did you follow the wiki? Don't forget the first step, as downloading the plugin directly from the Github page doesn't include the submodules.

Resources