简体   繁体   English

为什么要求在 android 模拟器上工作而不在 google play 商店应用程序上工作?

[英]Why request working on android simulator but not working on google play store app?

I have basic user login system datas come from http://www.birdpx.com/mobile/m_login (web site belongs to me) adress.我有来自http://www.birdpx.com/mobile/m_login (网站属于我)地址的基本用户登录系统数据。 But on similator requset working properly but it comes to app that downloaded google play store.但是在模拟器请求上正常工作,但它涉及下载谷歌播放商店的应用程序。 Request not working Here is my login codes?请求无效 这是我的登录代码? By the way everything works on app store correctly .顺便说一下,在应用商店中一切正常。 When submiting the codes (function) below work提交以下代码(功能)时

_handleSubmit=async (values)=>{


    this.setState({
      loading: true
    })


    const datam = { name: values.username, password: values.password };

    const rest = await fetch('http://www.birdpx.com/mobile/m_login', {
      method: 'POST',
      headers: { 'Accept': 'application/json', 'Content-type': 'application/json' },
      body: JSON.stringify(datam)
    });


    const gelenVeri = await rest.text();
    let convertedVeri=JSON.parse(gelenVeri);


    if (convertedVeri.status == 1) {


      await this.setState({
        userToken: 1
      })

      let giris = { token: this.state.userToken,user:convertedVeri.kullanici }
     
      await AsyncStorage.setItem('isLoggedIn', JSON.stringify(giris));
      const atama = await AsyncStorage.getItem('isLoggedIn');
      const atamaVerisi = JSON.parse(atama);

     

      if (atamaVerisi.token === 1) {
        
        setTimeout(() => {
          this.props.navigation.navigate('Home');
        }, 2000)


      } else {

        this.setState({
          loading: false
        });
        alert("Beklenmedik Bir Hata Oluştu");
      }
    } else {
      this.setState({
        loading: false
      });
      alert("Giriş Başarısız");

    }

  
  }

What do you think about that is that a problem about http/https issue and if it is how can , solve it?你怎么看这是一个关于http/https问题的问题,如果是,如何解决?

From Android 9 Pie now, requests without encryption(https) will never work.从现在的 Android 9 Pie 开始,没有加密(https)的请求将永远无法工作。 To enable requests to all types of connections HTTP and HTTPS in Android 9 Pie and above, use this attribute to your AndroidManifest.xml where you allow all http for all requests:要在 Android 9 Pie 及更高版本中启用对所有类型的 HTTP 和 HTTPS 连接的请求,请将此属性用于您的 AndroidManifest.xml,其中您允许所有请求的所有 http:

<application android:usesCleartextTraffic="true">
</application>

Source: https://developer.android.com/about/versions/pie/android-9.0-changes-28#tls-enabled来源: https : //developer.android.com/about/versions/pie/android-9.0-changes-28#tls-enabled

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android 应用发布到 Play 商店后无法运行 - Android app not working after published to Play Store Android应用程序注册/登录在Play商店中不起作用 - Android app Signup/login not working in the play store 从App Store或Google Play下载时,Android App无法正常工作 - ANR - Android App not working when downloaded via App Store or Google Play - ANR 使用 Android Studio Android 应用程序在设备上运行 Google plus 但从 Play 商店下载时不起作用 - Using Android Studio Android app Working Google plus on device but when downloaded from play store Not Work 在Google Play商店中发布应用后,Google地图无法正常工作 - Google Maps is not working properly after publishing an app in Google Play store 应用在 Microsoft App Center 中运行,但在 Google Play 商店开放测试中运行 - App working in Microsoft App Center but not Google Play Store Open Test 将应用上传到Play商店后,为什么Google Maps服务无法正常工作? - Why google maps services isn't working after uploading app to Play Store? React原生Android应用程序在一部手机上工作,但在另一部手机上崩溃(通过谷歌游戏商店生产) - React Native android app working on one mobile but crashing on another mobile (in production through google play store) Android Google Map API v2突然停止在Play商店中的我的应用中工作 - Android Google map API v2 suddenly stopped working in my app that was in the Play store 当我在 Android 设备上部署应用程序但不是通过 Play 商店部署时,谷歌地图不起作用 - google map not working when i deploy the app in android device but not via play store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM