Closed arthursp closed 6 years ago
Hi @arthursp , If the Auth merged, what should the server side do?
Hi @vaenow,
on the server side, just need to add basic auth.
I tested with a simple htaccess and htpasswd with an apache server :
AuthType Basic
AuthName "Password Protected Area"
AuthUserFile /var/www/apkmanager/.htpasswd
Require valid-user
and the htpasswd :
test:$apr1$XQ6wTvJB$rgTrtnB06BGyI3JXJlFjE.
test:test as user:password
For the ionic native plugin ( in case of ) :
export class AppUpdate extends IonicNativePlugin {
/**
* Check and update
* @param updateUrl {string} update api url
* @param options {json} options object
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova({
callbackOrder: 'reverse'
})
checkAppUpdate(updateUrl: string, options?: any): Promise<any> { return; }
}
I want to do like the following but i can't because appUpdate.checkAppUpdate in my code have one parameter.What do i need to do?please someone answer me........
appUpdate.checkAppUpdate(onSuccess, onFail, updateUrl, { 'authType' : 'basic', 'username' : 'test', 'password' : 'test' })
@johnhtet691
in the ionic native plugin :
export class AppUpdate extends IonicNativePlugin {
/**
* Check and update
* @param updateUrl {string} update api url
* @param options {json} options object
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
@Cordova({
callbackOrder: 'reverse'
})
checkAppUpdate(updateUrl: string, options?: any): Promise<any> { return; }
}
Thank you for replying.You mean that you want to change AppUpdate class(index.d.ts) in my code situated node-modules as showing you.But I change the code as you show, I got the error like this 'An Implementation cannot be declared in ambient contexts ". I think that i need to do something .Please show the way. :) :)
My original code is the following like that.
export declare class AppUpdate extends IonicNativePlugin { /**
in /node_modules/@ionic-native/app-update/index.d.ts
Which version of typescript do you have ?
You may use : npm install --save typescript@latest
This hasn't been included in the ionic native plugin yet?
Nope, not yet :S
Hey all, I created a PR to add this feature. Wait for our next release
Add an option to use basic auth for config.xml and apk URI.
usage :
Also need to update IONIC native wrapper ( work in progress )