Posts

Post not yet marked as solved
1 Replies
655 Views
I have created a script to return a valid jwt token for mapkitjs. I have attempted to use both the fetch and xhr methods to call the script, and both methods receive the token, which I can display using a javascript alert call. I know the token is a good token because I can copy the token from the alert and brute force it into the code and the map is displayed. However, I cannot figure out what is wrong with the token in terms of the "expected pattern." I receive this error in the javascript console: "Unhandled Promise Rejection: SyntaxError: The string did not match the expected pattern." I return a simple string that is only the token itself. I have tried returning a json object like {"jwt":"the token"} or {"JWT":"thetoken"}. I tried changing res.test() to res.json(), although probably not at the some time as when I returned the json object. But then, I don't think that is the real problem, because Apple's description on using the token would not be ... then(res => res.text()). Naturally, I assumed that a text string exactly like is quoted using ... 'const jwt = "thetoken"' was what I was supposed to return to the fetch call. Can someone please tell me what I don't understand about the "expected pattern?"
Posted
by Websawyer.
Last updated
.
Post not yet marked as solved
2 Replies
734 Views
I am trying to use mapkitjs. I have used mapkit on ios extensively, but would like to use mapkitjs, as well. When I load a simple webpage, the page generated by the dashboard when I generated a token on the dashboard, the javascript console shows that the resources are not loading because the webpages cannot be found by Safari. One page, for instance, is: https://mw-ci1-mapkitjs.geo.apple.com/admin/source-maps/5.75.101/source-maps/libs/mapkit.core.f5d12d.js.map There are several others, as well. The map does display correctly, I am able to declare a coordinate and region and have the map display the map showing that region. However, attempting to add an annotation does not work, as the variable MarkerAnnotation can not found. The error is: [Error] Unhandled Promise Rejection: ReferenceError: Can't find variable: MarkerAnnotation I have tried changing the library from "map" to "full-map" and that does not seem to help. I do not understand why all the mapkitjs libs cannot be found by Safari. Is it because at this early stage I am just hardcoding the token in the page? Nothing indicates this is a problem.
Posted
by Websawyer.
Last updated
.
Post marked as solved
1 Replies
774 Views
I might be mistaken, but I believe visionKit has been made integral to ios16 and/or xCode14. My app now has a lot of visionKit entries in the log. I have a sense that this is expensive on a scrolling tableview of videos. First, how is it possible to simply prevent the prying eyes of visionKit from performing their invasive tasks? Second, am I mistaken about the added weight, especially once the kit gets its teeth into a video? Third, is this why the controls do not show up, because no displayed controls is very confusing to the app user? TIA
Posted
by Websawyer.
Last updated
.