Sponsored

BHunted1

Well-known member
First Name
John
Joined
Mar 17, 2021
Threads
2
Messages
400
Reaction score
104
Location
Sumner County TN
Vehicles
2021 Ford-150 Platinum Hybrid
Occupation
Retired
Installed latest script iPhone 12 Pro. Works but still can’t change metric to us, ie miles vs kilometers. Click on setting, screen jumps but still says metric.
Sponsored

 
OP
OP
tonesto7

tonesto7

Well-known member
First Name
Anthony
Joined
Mar 7, 2021
Threads
5
Messages
313
Reaction score
387
Location
Michigan
Vehicles
2021 Lariat 502A | 3.5L EB
Occupation
IT Admin | Software Developer
Installed latest script iPhone 12 Pro. Works but still can’t change metric to us, ie miles vs kilometers. Click on setting, screen jumps but still says metric.
ok I will investigate.
 

tcp

Well-known member
First Name
Trieu
Joined
Oct 1, 2020
Threads
1
Messages
87
Reaction score
20
Location
Kansas City,MO
Vehicles
2021 F150 Platinum, 2019 Accord
Occupation
IT MGR
I'm on the new script version and the home screen widget no longer works. Error says "Alerts are not supported in a widget" Also notice that my session is not staying logged in, keeps prompting to login with un/pw and VIN every time I open. Seems like the new code is clearing cached credentials or something.

Maybe this part of the change is causing this >>>

  • Added the ability to hardcode an id into the script to allow for multiple instances for multiple vehicles. See the SCRIPT_ID in the script header (Not fully tested).
 
OP
OP
tonesto7

tonesto7

Well-known member
First Name
Anthony
Joined
Mar 7, 2021
Threads
5
Messages
313
Reaction score
387
Location
Michigan
Vehicles
2021 Lariat 502A | 3.5L EB
Occupation
IT Admin | Software Developer
I'm on the new script version and the home screen widget no longer works. Error says "Alerts are not supported in a widget" Also notice that my session is not staying logged in, keeps prompting to login with un/pw and VIN every time I open. Seems like the new code is clearing cached credentials or something.

Maybe this part of the change is causing this >>>

  • Added the ability to hardcode an id into the script to allow for multiple instances for multiple vehicles. See the SCRIPT_ID in the script header (Not fully tested).
Tap on the widget to run it manually and it should work.
 

tcp

Well-known member
First Name
Trieu
Joined
Oct 1, 2020
Threads
1
Messages
87
Reaction score
20
Location
Kansas City,MO
Vehicles
2021 F150 Platinum, 2019 Accord
Occupation
IT MGR
Tap on the widget to run it manually and it should work.
It works when I run it manually but for some reason the IOS home screen widget no longer works. It may be related to the always prompting for creds now when I run it manually. When I remove the widget from home screen and readd it briefly display data then errors to the error.
 

Sponsored

tcp

Well-known member
First Name
Trieu
Joined
Oct 1, 2020
Threads
1
Messages
87
Reaction score
20
Location
Kansas City,MO
Vehicles
2021 F150 Platinum, 2019 Accord
Occupation
IT MGR
It works when I run it manually but for some reason the IOS home screen widget no longer works. It may be related to the always prompting for creds now when I run it manually. When I remove the widget from home screen and readd it briefly display data then errors to the error.
Screenshot of error.

Ford F-150 Lightning FordPass - Scriptable Widget (iOS, iPad, MacOS) 1639877865442
 

Bassjammz

Member
First Name
Jeremy
Joined
Apr 2, 2021
Threads
2
Messages
11
Reaction score
0
Location
Ohio
Vehicles
2021 f150
Occupation
IT
Ford F-150 Lightning FordPass - Scriptable Widget (iOS, iPad, MacOS) 1639880040680

I am getting this error. Any thoughts
 
OP
OP
tonesto7

tonesto7

Well-known member
First Name
Anthony
Joined
Mar 7, 2021
Threads
5
Messages
313
Reaction score
387
Location
Michigan
Vehicles
2021 Lariat 502A | 3.5L EB
Occupation
IT Admin | Software Developer
It works when I run it manually but for some reason the IOS home screen widget no longer works. It may be related to the always prompting for creds now when I run it manually. When I remove the widget from home screen and readd it briefly display data then errors to the error.
Open the scriptable app and tap on the ... on the ford pass widget.
Slide up the log view and press play bottom right.

Try logging in again. If it fails review the logs.
 

Bassjammz

Member
First Name
Jeremy
Joined
Apr 2, 2021
Threads
2
Messages
11
Reaction score
0
Location
Ohio
Vehicles
2021 f150
Occupation
IT
Open the scriptable app and tap on the ... on the ford pass widget.
Slide up the log view and press play bottom right.

Try logging in again. If it fails review the logs.
Ford F-150 Lightning FordPass - Scriptable Widget (iOS, iPad, MacOS) 1639881654144

It runs but still the same error
 

Sponsored
OP
OP
tonesto7

tonesto7

Well-known member
First Name
Anthony
Joined
Mar 7, 2021
Threads
5
Messages
313
Reaction score
387
Location
Michigan
Vehicles
2021 Lariat 502A | 3.5L EB
Occupation
IT Admin | Software Developer
1639880040680.png

I am getting this error. Any thoughts
There is only one location in the code that the widget itself uses the Alert functionality and that's in the new vinCheck() function.
It checks to make sure your VIN is correctly formatted and doesn't contain any special characters.
I just added a check to prevent the alert function from being used.

Bottom line it doesn't like the format of your VIN
Code:
async function vinCheck(vin, setup = false) {
    vin = vin || (await getKeychainValue('fpVin'));
    let vinLen = vin && vin.length === 17;
    let vinChar = vin && vin.match(/^[a-zA-Z0-9]+$/);
    let msgs = [];
    if (vin) {
        if (setup && !vinLen) {
            msgs.push('VIN Number is not 17 characters long!');
        }
        if (setup && !vinChar) {
            msgs.push('VIN Number contains invalid characters!\nOnly A-Z, 0-9 are allowed!');
        }
        if (msgs.length > 0) {
            console.log(`VIN Format Issues | Current VIN: ${vin} | Errors: ${msgs.join('\n')}`)
            if (!config.runsInWidget) { //Added this to prevent the Alerts not supported in widgets error
                await showAlert('VIN Validation Error', msgs.join('\n'));
            }
            return false;
        } else {
            return true;
        }
    }
    return false;
}
 
OP
OP
tonesto7

tonesto7

Well-known member
First Name
Anthony
Joined
Mar 7, 2021
Threads
5
Messages
313
Reaction score
387
Location
Michigan
Vehicles
2021 Lariat 502A | 3.5L EB
Occupation
IT Admin | Software Developer
@tcp You need to remove that token info ASAP... It's not going to allow someone access because it expires after a few minutes, but shouldn't share it none the less.

I don't see any reason why yours isn't working... I did see someone report that the deviceLanguage variable was causing a constant login prompt. I will remove that variable requirement.
 
  • Like
Reactions: tcp
OP
OP
tonesto7

tonesto7

Well-known member
First Name
Anthony
Joined
Mar 7, 2021
Threads
5
Messages
313
Reaction score
387
Location
Michigan
Vehicles
2021 Lariat 502A | 3.5L EB
Occupation
IT Admin | Software Developer
OP
OP
tonesto7

tonesto7

Well-known member
First Name
Anthony
Joined
Mar 7, 2021
Threads
5
Messages
313
Reaction score
387
Location
Michigan
Vehicles
2021 Lariat 502A | 3.5L EB
Occupation
IT Admin | Software Developer
Installed latest script iPhone 12 Pro. Works but still can’t change metric to us, ie miles vs kilometers. Click on setting, screen jumps but still says metric.
I just remembered the last release pulls in your units of measurement from the ford API on your account. It should match what is shown in the FordPass app.
Sponsored

 
 





Top