here in this code none of the state inside if condition is working on ios but its working on android phones. I am using expo go app for working ios/android.
ProfileService.getDashboardInfo(res,0).then(res=>{
if(res?.success){
setloading(false)
setdashboardInfo(res?.data)
setCount(res?.data?.pendingJobs)
}
})
any kind of suggestions will be appreciated.
Related
Is there already a solution to clear cookies in an expo based React Native app?
// this works only with android
const RCTNetworking = require('react-native/Libraries/Network/RCTNetworking');
return RCTNetworking.clearCookies((cleared: any) => {
console.log(cleared);
});
This package does not work with expo apps: https://github.com/react-native-cookies/cookies.
Are there any other solutions?
I'm using Expo's iOS simulator with my React Native app. Before, it would live update / "fast refresh" when code changes were made, but it's no longer doing that. So this is not about using the Expo Go app on my phone, but rather the Simulator on my Macbook.
I've checked the shake (ctrl + cmd + Z) menu, and Fast Refresh is still enabled. Running npx expo run:ios does correctly reflect the latest code, but that takes a while to run.
Any help to debug this?
A few days ago the same thing happened to me and it depended on how I exported the main component to App.tsx.
This one doesn't work properly:
export default () => {
return <View/>
}
This one works:
const App = () => {
return <View/>
}
export default App
Let me know if this helps
I'm developing a mobile app both for iOS and Android, I didn't have any issues on android. But in iOS I encountered a problem when using plugins. Plugins I used were cordova-file-transfer and social sharing by EddyVerbruggen. Both plugins worked perfectly when I created my android app, but both got an issue when I did it in iOS. Both plugin only works after I restart the app. Why is that? I tried surrounding the code with $ionicPlatform.ready and device.ready but didn't help. What am I missing?
Here's a sample sequence code:
$scope.myButton = function(){
//I also tried surrounding this with
//document.addEventListener("deviceready", myfunction, false)
$ionicPlatform.ready(function(){
//mycode here that uses the plugin ex. ($cordovaFileTransfer.download)
});
}
After following this tutorial I managed to integrate a Unity app into a native iOS app. The problem I'm currently facing is when I try to go back from the Unity part to native iOS.
For Android I solved this by doing something like:
public void ReturnToNative()
{
#if UNITY_ANDROID
AndroidJavaClass jc = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject> ("currentActivity");
jo.Call ("goBack");
#endif
#if UNITY_IOS
Application.Quit();
#endif
}
The native Java method "goBack" basically stops and then finishes an activity that contains the Unity part.
I know that for iOS the solution is not an Application.Quit(), I should use an iOS Plugin.
So my question is, what should this plugin do? How could I make it work?
I know how to create plugins, but I don't know what this particular plugin should contain.
Any help / hint / direction / comment is greatly appreciated!!
PS. I'm using Unity 5.4.2 and Xcode 8.0. The Unity part uses the Google Cardboard SDK.
For using native plugins on iOS read the following info:
https://docs.unity3d.com/Manual/NativePlugins.html
https://docs.unity3d.com/Manual/PluginsForIOS.html
It's been a couple of months since this question, but in case anyone else runs into a similar issue, here's how I managed to resolve this.
we have migrated a worklight 6.1 application t IBM mobilefirst 7.0 platform and all the functionalities working as expected on the android environment, but in ios we are facing an issue: there is a function called "quick receipt". on click on a button the device camera opens and a photo is taken. The problem is that the photo is not displaying - it returns complete blank page this issue on ios device only but not on Android device.
Camera.DestinationType.FILE_URI is not working on IOS.
for security reason we wont share the code. here is similar prototype code.
html
<div><img alt="QuickReceipts" src="resources/img/camera.png" onclick="imgCapture();"</div>
JavaScript
imgCapture: function (){
navigator.camera.getPicture(this.onSuccess, this.onFail,{quality:80,destinationType:Camera.DestinationType.FILE_URI, targetWidth:600,targetHeight:1050}
},
onSuccess:function(imgData)
{
// applying the css and displaying the img
$("#imgReceipt").attr("src","data:image/jpeg;base64," +imgData);
$("#imgReceipt").css("display", "block");
}
onFail:function(imgData){
// failure msg
}
One suggestion is to attempt to code change as mentioned by Nazmul: http://www.telerik.com/forums/ios-cordova-3-5-0-camera-getpicture-targetwidth-issue.
Another suggestion is to upgrade to the latest 7.1 iFix from IBM Fix Central which contains several Cordova corrections and may address your issue.
If your issue is not resolved still, I suggest to open an IBM PMR (support ticket).