can't receive data from ionic web service https to http - asp.net

I have an ionic app. I need to convert the urls in the web service from https to http. I changed it but I can't connect to the web service. How can I solve this problem? Thanks.
Ionic:
Ionic CLI : 6.13.1 (C:\Users\xxx\AppData\Roaming\npm\node_modules\#ionic\cli)
Ionic Framework : #ionic/angular 5.5.2
#angular-devkit/build-angular : 0.1000.8
#angular-devkit/schematics : 10.0.8
#angular/cli : 10.0.8
#ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : 6.0.0, android 9.1.0, browser, ios 6.2.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 13 other plugins)
Utility:
cordova-res : 0.15.3
native-run : 1.3.0
System:
NodeJS : v14.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.14.9
OS : Windows 10

I don't know, which plugin, which native run time you are using.
But I am using capacitor with #ionic-native/http plugin.
Add "useClearTextTrafffic='true'" in android manifest's application tag. That's it.

Related

How to fix --bar-background-active: not working?

I am trying to customize the ion-range in my app based on the wireframe. I tried to use --bar-background-active but seems not working. Please refer to my codes below. I removed the color="primary" in the ion-range attribute since the bar-background is blue also, I need to change it to gray to align with the wireframe. Hope you can help me. Thank you
Wireframe
Actual
.html
<ion-range
class="range-position"
min="1"
max="6"
dualknobs="true"
pin="false"
snaps="true"
ticks="false"
//removed the color="primary"
list="tickmarks"
[(ngModel)]="range"
(ionChange)="changeFunction($event)"
>
</ion-range>
.scss
ion-range {
--bar-background-active: #0e82c1;
--bar-background: gray;
--bar-height: 0.5px;
--knob-size: 18px;
display: block;
}
ionic info
Ionic:
Ionic CLI : 6.13.0
Ionic Framework : #ionic/angular 5.4.3
#angular-devkit/build-angular : 0.1000.8
#angular-devkit/schematics : 10.0.8
#angular/cli : 10.0.8
#ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : android 8.1.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 21 other plugins)
Utility:
cordova-res : not installed
native-run : not installed
System:
NodeJS : v15.3.0
npm : 7.5.4
OS : Windows 10
I have the same issue and I resolve the problem that you need to remove the color attribute. And it works perfectly :D. Good luck

Adding Firestore dependency causes error in Flutter app

Adding cloud_firestore: ^0.12.10 dependency in my flutter project gives errors.
These are the dependencies my project has:
dependencies:
url_launcher: ^5.0.0
flutter_launcher_icons: ^0.7.4
cloud_firestore: ^0.12.10
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
firebase_messaging: ^5.1.6
dev_dependencies:
flutter_test:
sdk: flutter
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/launcher_icon/LauncherIcon.png"
I tried to use different cloud_firestore versions, but none of them worked.
This is the output of flutter run command in the terminal:
Launching lib\main.dart on SM A505F in debug mode...
Initializing gradle... 1.1s
Resolving dependencies... 16.3s
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
FAILURE: Build failed with an exception.
* What went wrong:
Failed to notify dependency resolution listener.
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.2.1,17.2.1]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
> The library com.google.firebase:firebase-iid is being requested by various other libraries at [[20.0.0,20.0.0]], but resolves to 17.1.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 11.8s
Gradle task assembleDebug failed with exit code 1
This is the output of flutter doctor -v:
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 10.0.18362.418], locale en-IN)
• Flutter version 1.9.1+hotfix.6 at D:\flutter_windows_v1.9.1+hotfix.2-stable\flutter
• Framework revision 68587a0916 (8 weeks ago), 2019-09-13 19:46:58 -0700
• Engine revision b863200c37
• Dart version 2.5.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\aditl\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 41.0.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
[√] VS Code (version 1.40.0)
• VS Code at C:\Users\aditl\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.6.0
[√] Connected device (1 available)
• SM A505F • RZ8M60LFVPP • android-arm64 • Android 9 (API 28)
! Doctor found issues in 1 category.
from you log errors
* What went wrong:
Failed to notify dependency resolution listener.
> The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[17.2.1,17.2.1]], but resolves to 16.5.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
> The library com.google.firebase:firebase-iid is being requested by various other libraries at [[20.0.0,20.0.0]], but resolves to 17.1.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
you need to update firebase core to 17.2.1 if you have added it to your gradle files,
Although this is an issue with your project not being androidX enabled
see how to migrate to androidX
update
Cannot fit requested classes in a single dex file (# methods: 81876 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
you need to enable multidex for your application
as follows
android {
defaultConfig {
...
minSdkVersion 16
targetSdkVersion 28
multiDexEnabled true
}
...
}
dependencies {
implementation "androidx.multidex:multidex:2.0.0"
}
Add this line of code in your android/build.gradle file in the bottom. I think you missed the step of adding the services plugin.
Try this
and put cloud_firestore: ^0.12.10 dependency below firebase_messaging dependency.
Code:
apply plugin: 'com.google.gms.google-services'
Add this line inside your target 'Runner' do block in your Podfile, e.g.:
# ...
target 'Runner' do
pod 'FirebaseFirestore', :git => 'https://github.com/invertase/firestore-ios-sdk-frameworks.git', :tag => '8.9.0'
# ...
end

(Ionic 4) Can't receive notification with firebaseX when app is in foreground

I use FirebaseX to receive notification in my application.
I correctly receive notification in the background. But when the app is in the foreground, nothing happens...
I have searched for this problem, but nothing works for me.
I have try to had the following data in the data content (when server call url to send notification)
[notification_foreground] => true
[tap] => true
Here is my plugin list :
cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-device 2.0.3 "Device"
cordova-plugin-dialogs 2.0.2 "Notification"
cordova-plugin-fcm-with-dependecy-updated 3.0.0 "Cordova FCM Push Plugin"
cordova-plugin-file 6.0.2 "File"
cordova-plugin-firebasex 5.0.0 "Google Firebase Plugin"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.1.1 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-speechrecognition 1.1.2 "Speech Recognition"
cordova-plugin-splashscreen 5.0.3 "Splashscreen"
cordova-plugin-statusbar 2.4.3 "StatusBar"
cordova-plugin-whitelist 1.3.4 "Whitelist"
ionic info:
Ionic:
Ionic CLI : 5.2.8
Ionic Framework : #ionic/angular 4.9.0
#angular-devkit/build-angular : 0.13.9
#angular-devkit/schematics : 7.3.9
#angular/cli : 7.3.9
#ionic/angular-toolkit : 1.5.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 8.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.1.1, (and 23 other plugins)
Utility:
cordova-res : 0.5.1
native-run : 0.2.7
System:
NodeJS : v10.16.0
npm : 6.10.1
OS : Windows 10
the code to subscribre to the message...
this.firebase.onMessageReceived().subscribe(notification => {
console.log('NOTIFICATION !!!!');
console.log(notification);
alert( JSON.stringify(notification) );
if (notification['tap']) {
this.navCtrl.navigateRoot('/test');
} else {
alert( JSON.stringify(notification) );
}
});
When the app is in the background, I receive the notification and when I tap on it, I have the alert message and console log.
But when the app is in the foreground, nothing is displayed.
Thanks for your help.
cordova-plugin-firebasex plugin isn't working with cordova-plugin-local-notification plugin I have already faced this issue into my current ionic ios application but with the android, it's working perfectly
According to #dpa99c
The problem is that both this plugin and cordova-plugin-local-notifications implements the same UNUserNotificationCenterDelegate willPresentNotification delegate and since delegates have a 1:1 relationship with their parent class, only one of the delegates is being called - in this case, the cordova-plugin-firebasex delegate in response to the notification created by cordova-plugin-local-notifications.
Please check the below link for the details description
https://github.com/dpa99c/cordova-plugin-firebasex/issues/230
Solution:
Please use this local notification plugin with cordova-plugin-firebasex It's working perfectly in android and iOS both platform
With --prod it seem to work without doing nothing else...
it's in debug mode that is not working
From https://github.com/dpa99c/cordova-plugin-firebasex#background-notifications
If the notification message arrives while the app is in running in the foreground, by default it will NOT be displayed as a system notification. Instead the notification message payload will be passed to the onMessageReceived callback for the plugin to handle (tap will not be set).
If you include the notification_foreground key in the data payload, the plugin will also display a system notification upon receiving the notification messages while the app is running in the foreground. For example:
{
"name": "my_notification",
"notification": {
"body": "Notification body",
"title": "Notification title"
},
"data": {
"notification_foreground": "true",
}
}
.Maigais
it's not about prod or QA or Debug Mode. For foreground messages to trigger you need to incorporate "notification_foreground": "true" under data Object in Notification Payload.
Example:
{
"to" : "your device token",
"notification" :{
"body" : "your message body",
"title": "your title for notification"
},
"data":{
"notification_foreground": "true"
}
}

Ionic HTTP POST reply net::ERR_NAME_NOT_RESOLVED

My Ionic Info is below:
cli packages: (C:\Windows\System32\node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
#ionic/app-scripts : 3.1.11
Cordova Platforms : android 7.0.0 browser 5.0.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.11.3
npm : 6.3.0
OS : Windows 7
Hi, I have built an app and it is working fine on the browser. But on the mobile I am getting this error, screenshot is below.
Below is the reply on the browser which is working fine.
I have restarted my phone.
I have cleared the app memory.
My config.xml is below.
The reply from the server is below.
**"HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nContent-Length: 10\r\nAccess-Control-Allow-Origin: \r\nAccess-Control-Allow-Headers: \r\n\r\n" + ipStr + “”;
As you can see, I have the Access Control Allow Origin there also.
Please help as I can't seem to solve the problem.

Ionic3 Execution failed for task ':app:transformClassesWithDexBuilderForDebug'

I have been dealing with this for the past 2 weeks now.I'm building an application with Ionic3. Everything worked fine, Untill I install phonegap push plugin. Then I start to get this error
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'. > com.android.build.api.transform.TransformException: java.lang.IllegalStateExce ption: Dex archives: setting .DEX extension only for .CLASS files
I have made research about this and none of the solution seemed to work for me. I have done below to app level build.gradle
defaultConfig {
multiDexEnabled true
}
i also added below code
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
Then I started gettin below error
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> java.io.IOException: Can't write
[C:\ionic\brinmiz\platforms\android\app\build
\intermediates\multi-dex\debug\componentClasses.jar] (Can't read
[C:\ionic\brinmiz\platforms\android\app\build\intermediates\transforms\desugar\debug\17.jar(;;;;;;**.class)] (Duplicate zip entry [17.jar:android/support/v4/media/RatingCompat$1.class]))
This is my Ionic info
cli packages:
#ionic/cli-utils : 1.19.1
ionic (Ionic CLI) : 3.19.1
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.8
Cordova Platforms : android 7.0.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.0.2
Node : v6.10.2
npm : 3.10.10
OS : Windows 8
Environment Variables:
ANDROID_HOME : C:\Users\Dd\AppData\Local\Android\sdk
Misc:
backend : legacy
Like I said, I have been on this for the past 2 weeks. I really need your solution
As explained here by the official documentation of Push Plugin, there is a known incompatibility between Push Plugin and another plugins that "are using an outdated way to declare dependencies such as android-support or play-services-gcm".
You can try to install cordova-android-support-gradle-release that will align various versions of the Android Support libraries specified by other plugins to a specific version.
cordova plugin add cordova-android-support-gradle-release --fetch
Also you can try to downgrade your cordova-android from 7.0.0 to 6.3.0 because there are also known issues with 7.x+. Delete your plugin folder(make sure you have all of them declared in config.xml) and run:
cordova platforms rm android
cordova platforms add android#6.3.0
If nothing do the job, update your answer with all the plugins used by your application using the next command and I will try to debug for you.
cordova plugin ls

Resources