ARKIT issue loading assets in virtual object - delay

ARKIT issue.
On upgrading the iPhone ios from 15.6 to ios 16, i am facing issue in loading virtual object contents on the screen.
Below mentioned code is working fine with iPhone iOS version 15.6.
In ios 16, below function is keep on calling in the code.
Tag: ProcessRaycastResults
private func setVirtualObject3DPosition(_ results: [ARRaycastResult], with virtualObject: VirtualObject) {
guard let result =
results.first else {
print("Unexpected case: the update handler is always supposed to return at least one result.")
return;
}
self.setTransform(of: virtualObject, with: result)
// If the virtual object is not yet in the scene, add it.
if virtualObject.parent == nil {
self.childNodesPortal = virtualObject.childNodes
self.getMatrials(scene: virtualObject.childNodes)
}
}
func getMatrials(scene:[SCNNode]){
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5 ) {
for child in scene {
material.diffuse.contents = "https//xyz.png"
material.normal.contents = "https//xss.png"
//setting here materials with the png images from url.
}
}
}
Anyone could suggest why there is variation for iOS version 16 device and what workaround I should do.

Related

Starting Microsoft Edge from MFC with web file paramater

If I open up a console prompt I can type this command:
start msedge "d:\HTML\Verticle Alignment.HTM"
It starts Microsoft Edge and opens the web page.
So I tried to do this programmatically in a test program using MFC:
void CMFCApplication8Dlg::OnBnClickedButton1()
{
ExecuteProgram(_T("start"), _T("msedge d:\\HTML\\Verticle Alignment.HTM"));
}
BOOL CMFCApplication8Dlg::ExecuteProgram(CString strProgram, CString strArguments)
{
SHELLEXECUTEINFO se = { 0 };
MSG sMessage;
DWORD dwResult;
se.cbSize = sizeof(se);
se.lpFile = strProgram;
se.lpParameters = strArguments;
se.nShow = SW_SHOWDEFAULT;
se.fMask = SEE_MASK_NOCLOSEPROCESS;
ShellExecuteEx(&se);
if (se.hProcess != nullptr)
{
do
{
dwResult = ::MsgWaitForMultipleObjects(1, &(se.hProcess), FALSE,
INFINITE, QS_ALLINPUT);
if (dwResult != WAIT_OBJECT_0)
{
while (PeekMessage(&sMessage, nullptr, NULL, NULL, PM_REMOVE))
{
TranslateMessage(&sMessage);
DispatchMessage(&sMessage);
}
}
} while ((dwResult != WAIT_OBJECT_0) && (dwResult != WAIT_FAILED));
CloseHandle(se.hProcess);
}
if ((DWORD_PTR)(se.hInstApp) < 33)
{
// Throw error
AfxThrowUserException();
return FALSE;
}
return TRUE;
}
But when I run it I get this error message:
So how can I launch my file in Microsoft Edge? I am using the latest Windows 10 so it is Microsoft Edge Chromium.
I have seen other questions which refer to making Edge the default browser and then just "opening" the data file and it working it all out but this is not OK in this case. In my editor I have a menu flyout which lists all the installed browsers (excluding Edge for now). But i want to add Edge so need to be able to programatically start it with my file to view.
Based on the comments provided to me, and to factor in for spaces in the file name, this works:
ExecuteProgram(_T("msedge"), _T("\"d:/HTML/Verticle Alignment.HTM\""));
The program to execute needs to be msedge and not start.
The parameter needs to be wrapped in " quotes.

Flutter slider with web

I am trying to build music player app which has slider, my current slider code shown below works fine with Mobile device but it doesn't work on Flutter web, it seems like flutter slider doesn't support slider on web yet. I tried finding out alternative packages but none of them seems to support web. Is there any customized version which we can use for web?
Widget slider() {
return Slider(
activeColor: Colors.white10,
inactiveColor: AppColors.red200,
label: inuseAudioinfo.duration.inSeconds.toString(),
min: 0.0,
max: (inuseAudioinfo.position.inSeconds ?? 0.0).toDouble(),
value: (getSleepkerPosition(inuseAudioinfo.position.inSeconds,
inuseAudioinfo.duration.inSeconds))
.toDouble(),
divisions: 9,
onChangeStart: (double value) {
print('Start value is ' + value.toString());
},
onChangeEnd: (double value) {
print('Finish value is ' + value.toString());
},
onChanged: (double value) {
setState(() {
if (value == inuseAudioinfo.position.inSeconds) {
} else {
seekToSecond(value.toInt());
value = value;
}
});
});
}
I was using https://pub.dev/packages/audioplayers plugin to get position and duration, it seems like this plugin doesn't support web yet. I replaced my code with https://pub.dev/packages/assets_audio_player and it worked.

CBCentralManager ScanForPeripherals with empty CBPeripheral name

I need to solve this issue with my app.
I try to scan the peripherals (Bluetooth devices) using the CBCentralManager from the CoreBluetooth in Xamarin.iOS, but when a peripheral is discovered it has an empty name sometimes, when I do the same from the iOS settings then it has a name.
I'm not searching for a specific UUID.
CBCentralManager manager = new CBCentralManager(CoreFoundation.DispatchQueue.MainQueue);
manager.DiscoveredPeripheral += (sender, e) =>
{
if (e.Peripheral != null)
{
Debug.WriteLine($"DiscoveredPeripheral: {e.Peripheral.Name} - {e.Peripheral.Identifier} - {e.AdvertisementData}");
PeripheralsList.Add(e.Peripheral);
CustomDeviceDiscoveredAction(this, new CustomBTEDevice
{
DeviceName = e.Peripheral.Name,
DeviceAddress = e.Peripheral.Identifier.AsString(),
DeviceGuid = Guid.Parse(e.Peripheral.Identifier.AsString())
});
}
};
manager.ScanForPeripherals(null, new PeripheralScanningOptions
{
AllowDuplicatesKey = false,
});
Check property LocalName in the advertisement data package
Also, my suggestions, do not rely on the device name, better rely on data in advertisement data

'keyboardDidHide' returns null instead of an object

I'm currently working on a react-native app and I'm trying to animate the layout of the login-screen when a keyboard is shown.
To track the state of the keyboard, I'm using this code:
componentDidMount() {
this.keyboardDidShowSub = Keyboard.addListener('keyboardDidShow', (event) => console.log(event));
this.keyboardDidHideSub = Keyboard.addListener('keyboardDidHide', (event) => console.log(event));
}
keyboardDidShow is working and returning:
Object {
"endCoordinates": Object {
"height": 286,
"screenX": 0,
"screenY": 354,
"width": 360,
},
}
However, keyboardDidHide is NOT working and returning null.
What could cause my problem? Thank you so much for your help!!
This is expected behaviour in Android. If you look at the underlying native code that is called when the keyboard is shown/hidden you can see what is sent back to the javascript side.
private void checkForKeyboardEvents() {
getRootView().getWindowVisibleDisplayFrame(mVisibleViewArea);
final int heightDiff =
DisplayMetricsHolder.getWindowDisplayMetrics().heightPixels - mVisibleViewArea.bottom;
if (mKeyboardHeight != heightDiff && heightDiff > mMinKeyboardHeightDetected) {
// keyboard is now showing, or the keyboard height has changed
mKeyboardHeight = heightDiff;
WritableMap params = Arguments.createMap();
WritableMap coordinates = Arguments.createMap();
coordinates.putDouble("screenY", PixelUtil.toDIPFromPixel(mVisibleViewArea.bottom));
coordinates.putDouble("screenX", PixelUtil.toDIPFromPixel(mVisibleViewArea.left));
coordinates.putDouble("width", PixelUtil.toDIPFromPixel(mVisibleViewArea.width()));
coordinates.putDouble("height", PixelUtil.toDIPFromPixel(mKeyboardHeight));
params.putMap("endCoordinates", coordinates);
sendEvent("keyboardDidShow", params);
} else if (mKeyboardHeight != 0 && heightDiff <= mMinKeyboardHeightDetected) {
// keyboard is now hidden
mKeyboardHeight = 0;
sendEvent("keyboardDidHide", null); // <- you can see here that when the keyboard is hidden it sends back null
}
}
It is worthwhile noting that in iOS that 'keyboardWillShow', 'keyboardDidShow', 'keyboardWillHide' and 'keyboardDidHide' will return an object.

How can I integrate a navigator app on a device

What is the best approach to make use of navigation features like route planning when I have an address in my Movelet and want to trigger a navigation via an external app on iOS, Android and Windwos Phone?
To jump into another app you need the Movilizer AppJump feature, with this you can open a connection (Module SPI) and trigger the execution in use of the exec command. What you or the user still has to do is to start the navigation manually by pressing the Start button in the maps app.
For the Android Client you need to use the protocol named geo. Geo gives you two opportunities, you can either enter the specific coordinates or enter an address.
The use of specific coords will look like this:
'geo:49.483611111111,8.463055555555697?z=18'
In case you don't know the coords you can also use:
'geo:0,0?q=Wilhelm-Varnholt-Allee 1, 68165 Mannheim?z=18'
In your code it will look like that:
if(platform == 11)
{
intentURL = conCat('geo:0,0?q=', destPoint,'?z=18');
conStr = conCat('exec:', intentURL);
}
For the iOS Client the URL scheme looks quite similar, but instead of using geo you need to use to point on the app which you want to open.
'exec:maps://?q=Wilhelm-Varnholt-Allee 1, 68165 Mannheim?z=18'
The use of maps:// will open the Apple Maps app if you want to have Google Maps you must use comgooglemaps://
I've prepared a small example this may helps you to solve the problem you have:
<question key="#1" type="6" title="Address">
<answer key="#1_0" nextQuestionKey="END" dummyAnswer="true"/>
<onEnterAssignment>
addresses =
{
'Diakoniekrankenhaus Mannheim' : 'Speyerer Str. 91, 68163 Mannheim';
'Moll-Gymnasium' : 'Feldbergstraße 16, 68163 Mannheim';
'Planetarium Mannheim' : 'Wilhelm-Varnholt-Allee 1, 68165 Mannheim';
'Karl Benz Stadion' : 'Theodor-Heuss-Anlage 20, 68165 Mannheim';
'Luisenpark' : 'Theodor-Heuss-Anlage 2, 68165 Mannheim';
'Mannheim City Airport':'Seckenheimer Landstr.172, 68163 Mannheim';
};
for(dest:addresses)
{
addAnswer($answer:'#1_0', dest, dest);
}
platform = getClientType();
</onEnterAssignment>
<onLeaveOkPersistAssignment>
destPoint = addresses[getQuestionValue()];
if(platform == 11)
{
intentURL = conCat('geo:0,0?q=', destPoint,'?z=18');
conStr = conCat('exec:', intentURL);
}
else
{
conStr = conCat('exec:maps://?q=', destPoint, '?z=18');
}
conID = connect(conStr, null);
if(isConnectionOpen(conID))
{
close(conID);
}
</onLeaveOkPersistAssignment>
I've also found another way on Android:
addressTxt = "Wenceslas Square, Prague, CZ";
connStr = concat("exec://", "%com.google.android.apps.maps%", "http://maps.google.com/maps?daddr=", addressTxt);
connection = connect(connStr, "name");
try
{
close(connection);
}
catch (exception)
{
}
Result on YouTube
For the navigation on Android, the following worked for me.
intentURL = '%com.google.android.apps.maps%google.navigation:q=Address';
conID = connect(concat('exec:', intentURL), "name");
if (conID ?ge 0)
{
close(conID);
}
Address could be: RMZ Eco World Rd, Adarsh Palm Retreat Villas, Bellandur, Bengaluru, Karnataka 560103, India

Resources