Upload file with ionic and Wakanda - upload

I try to upload file directly to an Image field.
When i try my dev on the browser, everything works fine (http://127.0.0.1:8100/ionic-lab).
The file upload correctly.
When i try on my android phone, I got a 403 Fordidden error
I enable the file upload Service in the settings file.
I add in the file persmissions.xml the following :
`<?xml version="1.0" encoding="UTF-8"?>
<permissions>
<allow type="service" action="upload" resource="upload" groupName="Admin" groupID="01000000000000000000000000000000" temporaryForcePermissions="false"/>
</permissions>`
My code is the following :
var file = document.getElementById('fileInput').files[0];
$scope.book.Image.$upload(file).$promise.then(function (e) {
$scope.book.$save();
});

It could come from a CORS problem.
So try to add these lines in the config.xml file:
<access origin="*"/>
<allow-intent href="*"/>
<allow-navigation href="*"/>
If it is not working, try to restore the state of your mobile application.
to do that, go into the mobile folder of your project and execute this line ionic state restore.
If this command line fail. Erase the platforms folder in your mobile folder and execute ionic state restore another time.
I hope that will help you.

Related

.appinstaller error - schema is not valid for OS

I'm getting the following error when attempting to install my .msix file via an .appinstaller file.
This .appinstaller file is using a new schema which is not valid on this OS version. Please update to the latest version of Windows 10.
I've tried various schemas /2017, /2017/2, /2018, 2021.
I've tried with 'Developer Mode' switched on & off.
There doesn't seem to be anything relating to the error in the event viewer in AppxDeploymnet-Server.
This is my .appinstaller file.
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2"
Version="1.0.0.0"
Uri="https://mywebsite.com/myapp.appinstaller" >
<MainPackage
Name="myapp"
Publisher="CN=myOrganisation"
Version="1.0.0.0"
ProcessorArchitecture="x64"
Uri="https://mywebsite.com/myapp.msix" />
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="0"
UpdateBlocksActivation="true"
ShowPrompt="true" />
<AutomaticBackgroundTask />
<ForceUpdateFromAnyVersion>true</ForceUpdateFromAnyVersion>
</UpdateSettings>
</AppInstaller>
This is the version of Windows I'm using.

Phonegap build fails with splash screen

I'm attempting to use the new phonegap build with CLI 7.0.1
The build fails with this error:
The following build commands failed:
CompileAssetCatalog /Library/Developer/Xcode/DerivedData/Our_HNZC_Learning_space-ddfmniquktwfmabpvilymbvzreak/Build/Intermediates/ArchiveIntermediates/Our\ HNZC\ Learning\ space/InstallationBuildProductsLocation/Applications/Our\ HNZC\ Learning\ space.app Our\ HNZC\ Learning\ space/Images.xcassets
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/private/project/cordova/build-release.xcconfig,-workspace,Our HNZC Learning space.xcworkspace,-scheme,Our HNZC Learning space,-configuration,Release,-destination,generic/platform=iOS,-archivePath,Our HNZC Learning space.xcarchive,archive,CONFIGURATION_BUILD_DIR=/private/project/build/device,SHARED_PRECOMPS_DIR=/private/project/build/sharedpch
I've added these to config.png
<icon src="res/icon.png" />
<splash src="res/splash.png" />
And I've added this plugin
<plugin name="cordova-plugin-splashscreen" />
And the files are in the right place.
Splash works fine, Icon is causing the error
Not sure what the exact problem is based upon the info you provided.
A starting point would be to remove the splashscreen plugin and re-add it:
cordova plugin remove cordova-plugin-splashscreen
cordova plugin add cordova-plugin-splashscreen
cordova prepare
I would suggest using an Icon and Splashscreen generator such as this one: http://phonegap.appiq.software/
It does all of the hard work for you and gives you the exact code for your config.xml
I hope this is helpful.

cordova ios build fails with phonegap

i build an app using phonegap and trying to do a build as follows
Cordova ios build
it ends up with
VSKUMAR-mac:ios vskumar$ cordova build ios
Error: Source path does not exist: icon.png
my config.xml has an entry like
<icon src="icon.png" />
And the /www folder does have the default phonegap's image with name icon.png
My versions are:
VSKUMAR-mac:ios vskumar$ cordova -version
6.5.0
VSKUMAR-mac:ios vskumar$ phonegap version
6.4.6
<icon src="icon.png" />
comment this line in config.xml file. It will not reflect to your application.
Or else put the "icon.png" file in www folder.
It will solve your error.

Cordova Plugin with third-party SDK

I'm trying to figure out how to create a Cordova iOS plugin with the PressReader framework. I'm an iOS developer and have no experience with Cordova, this is why I hope to find some guidance here.
This is what i have done:
Created a plugin
Added the Objective-C classes to src/iOS
Added the PressReader_SDK.framework to src/iOS (is this the right place ?)
Edited the src/www/js file
Edited the plugin.xml with the following in the iOS platform:
<config-file target="config.xml" parent="/widget">
<feature name="Hello">
<param name="ios-package" value="HWPHello" />
</feature>
</config-file>
<resource-file src="src/ios/PressReader_SDK.framework"/>
<framework src="src/ios/PressReader_SDK.framework" custom="true" />
<framework src="Foundation.framework"/>
<framework src="UIKit.framework"/>
<header-file src="src/ios/HWPHello.h" target-dir="HelloPlugin"/>
<source-file src="src/ios/HWPHello.m" target-dir="HelloPlugin"/>
After this I've created a new Cordova app, added the plugin and then the iOS platform.
When opening the Xcode project from platforms/iOS I get the following Build error:
error: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/PressReader_SDK.framework: No such file or directory
Trying to run the app from terminal (cordova run ios --device) gives me the following error:
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/Andrei/desktop/hello/platforms/ios/cordova/build-debug.xcconfig,-workspace,Hello.xcworkspace,-scheme,Hello,-configuration,Debug,-destination,generic/platform=iOS,-archivePath,Hello.xcarchive,archive,CONFIGURATION_BUILD_DIR=/Users/Andrei/desktop/hello/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/Andrei/desktop/hello/platforms/ios/build/sharedpch
PS. the SDK does not seem to work on the simulator, and I need to test the app on a real device.

error : package com.google.android.gms.auth does not exist in ant release in cordova app

I installed cordova-plugin-googleplus plugin to login using google. After installing I run "cordova build andriod" in CLI, it was successful and apk file works fine for google login. Then for releasing the app I run "ant release" in platforms/android folder in CLI, then build failed with errors like " package com.google.android.gms.auth does not exist import com.google.android.gms.auth". Please give me the solution for this.
Thanks in advance.
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/252
Replace
<framework src="com.google.android.gms:play-services-plus:+" />
<framework src="com.google.android.gms:play-services-identity:+" />
with
<framework src="com.google.android.gms:play-services-plus:9.0.2" />
<framework src="com.google.android.gms:play-services-identity:9.0.2" />
in both plugin.xml as well as platforms/android/project.properties. In my case if I replace only plugin.xml then build.gradle was getting overridden with project.properties content and + version was being used instead of specific version

Resources