I'm getting an incorrect time in an AppMaker App and so I added this console.log statement to see what it was returning.
function getTodaysDate(){
console.log('Time Zone is ',Session.getScriptTimeZone());
return Utilities.formatDate(new Date(),Session.getScriptTimeZone(),"E MMM d, yyyy HH:mm");
}
Here's the return:
Sat Dec 09 09:54:38 GMT-700 2017 Time Zone is America/Los_Angeles
However, I live in another timezone. In fact, you you can see my time zone in the console log response.
The problem is that I don't know where to change this in App Maker and the instructions that pop with code completion seem to refer to the old script editor and not the App Maker Editor.
So for now I'm not using Session.getScriptTimeZone() but simply hardwiring it to "GMT-7".
instructions that pop with code completion seem to refer to the old script editor and not the App Maker Editor
It is totally OK, since App Maker is generating Apps Script apps.
File -> Project properties
You don't access to this configuration, since Apps Script project(App Maker deployment) is hidden/encapsulated by App Maker application and App Maker doesn't provide a way to configure these properties at this time...
We have a video showing how you can solve this with the AMU Library
Related
Background:
I'm quite new to App Maker, but have been involved in programming/IT for over 2 decades.
I have created an App Maker app, which works fine. It is deployed, and functions internally in our organization.
It accesses a Team Drive spreadsheet, makes modifications to it based on input criteria, and sends an email out to a hardcoded user. It uses no external GCP database or other resource.
The OAuth scopes it requires are:
admin.directory.user.readonly
drive.readonly
script.send_mail
spreadsheets
userinfo.email
Problem:
I can no longer preview the app.
When I click on "Preview" at the top right, a new tab opens and a spinning wheels seems to indicate that the preview is loading. Within about 4 seconds, the tab closes and the original tab (with the scripts, UI etc) gives a "Previewing failed. Dismiss" error in the bottom centre.
I am both able to deploy the exact same code/UI/etc, as well as run it without issue.
I do not know what I changed, since being able to preview the app, but cannot seem to regress to that state.
What I've tried:
Admittedly not much, as I don't know where to look. I'm rather certain that there must be some setting somewhere, but for all my googling, I've come up empty.
This can't be a client/server script or other syntax issue, as otherwise the deployment also wouldn't work.
With a more meaningful error, I would know where to look.
Expected Result:
Obviously, I should be able to preview the app if it is deployable.
Following #Morfinismo's comment, I contacted G Suite Support; my matter was escalated to the API Team.
I was asked by Google Cloud Support ("Support") to provide network traffic info using FiddlerCap. As I am on a linux machine and FiddlerCap is a windows application, I suggested alternatives (eg:Wireshark). It was eventually not required and never provided.
I noticed that on the Google scripts page, when accessing the project in question selecting "Preview", it was missing the following OAuth:
https://www.googleapis.com/auth/admin.directory.user.readonly
The functioning deployed version did not have this missing.
Still in the Preview, I selected "Stackdriver (logs)", which gave me an error that the project had been deleted. The actual wording was:
Access forbidden
Project XXXX is shut down and scheduled to be deleted. A project owner can cancel the shutdown on the projects list page.
Clicking on the link in the error "Go to projects list page" brought me to a page with the title "Resources pending deletion", which did not load a list of projects (but otherwise fully loaded) and would display the spinning wheel in perpetuity. I attempted this multiple times, including leaving it overnight once.
Support presumed that I had deleted the GCP project, although I honestly don't/didn't think I had. I also confirmed that creating new previews did not work, but creating new deployments did. I also confirm(ed) that this particular App Maker app did not require (eg) a GCP SQL database.
Support pointed me toward the following website: Google undelete project and I was asked to follow these steps (copy-pasted here):
a. For projectId, enter your project ID. From the screenshot you provided, this is "XXX (redacted)" (the quotes are just to emphasise the project ID, you shouldn't enter them.
b. Click EXECUTE.
c. You'll be prompted to grant authorisation, which may be preceded by a prompt to choose your admin account. Please do so.
d. You should receive a 200 response, with an empty body, that is {}.
e. Attempt to access the project via Project link (with the actual project id redacted here).
The above yielded some strange behaviour:
a. undeleteing the project gave it a different name that the App Maker app;
b. I notice that I had 3 other projects all called correctly (the App Maker app name).
c. When asked to reauthorize, I was provided with yet another project name ("Untitled project"), which was different from the correct one and different from the one in para. 7a, above.
d. I then also obtained another error in a new window which read:
That's an error
Request Details
(a bunch of stuff)
That's all we know.
Support advised that there may be a propagation issue, and that I should wait up to 30 minutes. I did, and it then worked! The only weird thing was the project name was wrong, but it was only for the preview, so I didn't really care.
If anyone needs additional information, I can PM screenshots I took along the way.
Hope this helps someone!
SJL
I am working on one side project, it has image view where a user can click and select an image from the photo library. I am using UIImagePickerController.
My question is I haven't added user Permission on plist nor anywhere else. and as far I know app crashed if you don't add permission, Plus when the app opens for the first time the dialog appears asking for permission but in my case, it's not asking.
I like to know how this can be possible or does Apple have changed something in new Xcode or OS?
I am using Version 9.2 (9C40b) and tried running the code on iPhone 6(real device iOS 11.2.6,) and in different simulator same result, I deleted the app and run it again, same no dialog.
And if Apple has changed something in iOS 11, Should we add or not the permission? whats the best way to a developer we don't want to ask, and also don't want the app to be crashed.
The answer is YES you have to provide the description
It is mandatory to add usage description(from iOS 11) of permissions you are going to use.
Apple states that
Your app is responsible for all usage of privacy-sensitive data, including access to this data by all third-party libraries used in your app. If your app attempts to access privacy-sensitive data without a usage description, your app will exit.
You will see this error in console log if permission description is not provided in Info.plist
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
If you try to submit the app without description for release Apple will reject it with this message
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSSpeechRecognitionUsageDescription key with a string value explaining to the user how the app uses this data.
Summary:
If you have not provided usage description and uploaded the app earlier then your app will crash without asking for permission
If you have not provided usage description and tried to submit recently then apple will reject it.
Reference:
Privacy Settings in iOS 10
I have built an app with Google App Maker which has a Suggest Box linked to a table by a Query parameter.
The app works correctly in Preview mode, but when I deploy it, the Suggest Box doesn't suggest anything!
I have deployed it once before (without a select box as I recall) and it worked correctly.
I tried redeploying to the original deployment and deploying to a new deployment, same result.
Am I missing some security setting or something?
I am using Drive Tables as my datasource. The kind people at Google sent me a couple of links which helped me to understand what's going on: previewing and publishing your application and running as user or developer.
The crux of the issue is that when you deploy an app and run it as user (default), it doesn't take any Drive Table data with it. If you want to add Drive Table data to the deployed app, you have to do this:
Open App Maker
Go to App Settings
Go to Deployments
Select your most recent deployment and click: “EXPORT DATA”
Make sure you select Preview from the Deployments drop down list.
Click Export
This will export all your Preview data to a new Google Spreadsheet.
Now go to your Drive models in the App Maker and click “IMPORT DATA FROM SHEET”
Here you can choose to import data to your Deployed version.
After completing the import process, you will have all your data in the Deployed app.
All courtesy of Google but I didn't find it in the docs, so it might help someone.
Use the browser console to see if there's an error on the connection, make sure the user has access to the datasource and if you're using cloud SQL check the parameters of cloudSQL in the publication
I have accidentally deleted my project at Google API Console and when I try to recreate it, It doesn't give me it's previous ID and attaches unwanted numbers at the end of it.
Is there any way to get that ID back?
If you have deleted a project on Google Developer console. You will get an email from Google something like this.
Dear Google Developers Console User,
You deleted the project “BigQuery” on Jul 16, 2015 6:33:44 AM PDT. If
you still want to delete this project, you don’t need to do anything.
The Google Developers Console team will remove your project
permanently one week from the time of your request.
If this project shouldn’t be deleted, you must visit the following URL
before Jul 28, 2015 12:50:21 PM PDT.
https://console.developers.google.com/project?pendingDeletion=true
After Jul 28, 2015 12:50:21 PM PDT, the project will be inaccessible
and can no longer be undeleted.
If you have any questions, please visit the Google Developers Console
Help at the following URL, or contact support.
https://developers.google.com/console/help/new/
Thanks, The Google Developers Console Team
If you ignore that email and allow the time to run out. Your project is gone and I have never known anyone to be able to get it back after that date. Check your email if you are lucky the date hasn't expired. If not your project is gone and you need to create a new one with a new project id and accept the consequences of deletion.
IMO: I really wish they would add a lock to projects so we can prevent ourselves from deleting something we really really should not.
Google project id is system generated and once the project is already deleted, you can't have the same id as before. I suggest you to check if the project is already "shutdown", because I believe that there's a 7 day grace period to recover it. Check out this google help documentation.
I dabbled with AppInventor a year ago and built an app that I now need to update on the Google Play marketplace.
Im NOW using Flex/FlashBuilder4.6 now and I have the new version of the app all tested and good to go but android developer console shows message stating that It has to be done with the same key...
is there any type of work around here or am I really going to have to just abandon that previous app and re-create a new app entry on Google Play?
I setup a new MIT account when it moved and can see a few test projects in the MIT App Invetor but dont see the app in question so perhaps that all of this is futile. I'll begin thinking I could setup the OLD app to show a message and then link that takes the user to the new app prole on google play but not having the zip file is a deal-breaker... any way around this at all?
Thank
The question is: did you create the apk file with App Inventor only (possible since Version 125, May, 6 2012) or did you use another tool like Marketizer or AppToMarket to sign the app?
In case you used App Inventor only, you could use the same package name of the old project.
The package name for an App Inventor project looks like that:
the first part of the package name is always the same for App Inventor projects appinventor.ai_ then follows your gmail login name and then after the . follows the App Inventor project name
example: appinventor.ai_taifunbaer.caturday
For signing the app you can use the alias=androidkey and key pwd=android, see also here