Is there a way to construct a local link with parameters that will work in both test and prod? I was planning to hard code it but realized the first part of the link being different would cause problems. (yes, I can create a script variable but that isn't ideal).
By this I mean links that end with #Files?id=100
Yes there is! You need to use this on the server script:
var appUrl = ScriptApp.getService().getUrl();
appUrl += "#Files?id=100;
Reference: https://developers.google.com/apps-script/reference/script/service#getUrl()
Related
I'm using the latest version of the here javascript sdk 3.1.32.0
When I use H.service.Url.MultiValueQueryParameter for my via points like
{
...,
via: new H.service.Url.MultiValueQueryParameter(['50.1234,8.7654', '51.2234,9.1123']);
}
I see in the URL params of my request this: &via=%5Bobject%20Object%5D
Someone an idea why this happens?
Thanks in advance!
When you use "via" parameter, you define a list of via waypoints. A via waypoint is not a native datatype recongnized by JavaScript, therefore, you will see in the URL params the word object refering to a particular data structure, in this case the via Waypoint composed mainly by Latitude, Longitude.
Regards.
This took a while to figure out the actual issue with the malformed url params. I was dynamically loading the here maps service script on mount of a component. Accidentally this happened in some cases twice. In both cases H was globally available and everything worked like expected. BUT when the script was loaded twice H.service.Url.MultiValueQueryParameter didn't return the correct params. It basically encoded them twice, or tried to.
The other side issue was that https://www.npmjs.com/package/#types/heremaps is outdated and doesn't cover MultiValueQueryParameter. So I had to remove the types and use my own. Else I probably would have realized the issue earlier.
I created a Firebase Deep Link for my Flutter app to open the app after the registration process was successful. The link looks like the following:
https://myLinkDomain.page.link/routeName/
During the registration process, a parameter must be appended to the end of the link, which I must read out in the app for successful completion.
The problem is that if I append the parameter to the end of the link, I can no longer access it. The link in this case looked like this:
https://myLinkDomain.page.link/routeName/?myCustomParam=myValue
If the parameter is given in the middle of the link, I can use it in the app. Like this:
https://myLinkDomain.page.link/routeName/?myCustomParam=myValue&apn=someStuff&isi=someStuff&ibi=someStuff&ifl=someStuff
However, the registration process requires that the parameter be added to the end of the link.
Is there a way to build the Firebase Deep Link so that the parameter can be added at the end and still be recognised in the app?
Thanks for any help!
No matter when this parameter goes - at start or at the end of the line.
I had the same problem with passing some custom parameters to my app.
Here is we should start with manual url construction:
firebase manual link construction
I have no easy way to pass parameters, so I just change the link parameter body to put here more parameters:
https://example.page.link/?link=https://example.com/?route%3Dprofile%26param1%3DA%26param2%3DB&apn=some&isi=some&ibi=some
prefix: https://redecor.page.link/
main body in link parameter (should be encoded). There is the place for all needed parameters you want to pass (route=profile¶m1=A¶m2=B) - all parameters should be encoded!
encoded should be like this: route%3Dprofile%26param1%3DA%26param2%3DB
other parameters (what are they means you could read here) for firebase proposes (no needs to encode):
apn=some&isi=some&ibi=some
Never mind. The solution is to change the order of the url parameters: myLinkDomain.page.link/routeName/…
I created this script to determine if the Session.getScriptTimeZone() would draw the time zone from the library file rather than AppMaker. Here's the script:
function getFormattedDateString(dt,format){
var format=format||"E MMM dd, yyyy HH:mm";
var dt=dt||new Date();
return Utilities.formatDate(new Date(dt), Session.getScriptTimeZone(), format);
}
I tested it in another script with the following code:
function test(){
Logger.log(AMSLib.getFormattedDateString(new Date()));
}
I went into AppMaker and this dialog:
I've tried the Script ID from here:
I've also tried several deployment ID's from the publish from Manifest dialog and I keep getting the same answer:
I've also tried the Project Key which is used with other apps scripts to load libraries.
I don't know what to try next.
First things first, you need to publish your Apps Script app, after that it'll be assigned Script ID(by the way it can also be found in the published app URL). Once you have Script ID, you can specify it in App Maker and select library version you want to use:
To access library's functions you need to use name specified in the object setting:
// Server side library call
var result = MyLibraryName.doSomeCoolStuff();
App Maker should be smart enough and pickup all library's public functions for autocomplete.
Learn more:
https://developers.google.com/apps-script/guides/libraries
https://developers.google.com/appmaker/scripting/libraries
That's really odd to not have a script key there. You might make a copy of your script, something might be corrupted. You can also get the key from the URL ex: https://script.google.com/a/ignitesynergy.com/d/1oHnk_xl76KagGS4g7O2pC1MM4R3iZR8-7FlmzKXxRDtO1o5nDU2/edit
Remember to File-> Manage Versions and create a version. You also need to set the sharing to public.
I'm struggling with unit tests in Meteor. I want to use the velocity, jasmine package but I must be doing something wrong. The tests don"t seem to work because the test can't find the code to test. The test project is available on github.
The code that i want to test is here:
https://github.com/robvanpamel/coderepository/blob/master/meteor/sandwich-app/server/Services/SandwichService.js
The unit Test is here:
https://github.com/robvanpamel/coderepository/blob/master/meteor/sandwich-app/tests/jasmine/server/integration/spec/SandwichServiceSpec.js
When I uncomment the created SandwichService in the Unit Test, the test works, which is normal.
I haven't done any configuration elsewhere in meteor, and i think that is the problem. Do you have to put a package.js file where you specify your source code?
How can Jasmine know where it can find the SandwichService I'm trying to test? It is also the error i get.
"ReferenceError: SandwichesService is not defined "
EDIT
I was able to resolve it and updated the code repository in GitHub. The key was not to use the Javascript prototypes. so the below will not work
function SandwichesService(){};
SandwichesService.prototype.listSandwiches = function() {
// do stuff here
}
while the code below does work
SandwichService = {
listSandwiches: function(){
// do stuff here
}
};
I don't really understand why? Does somebody can tell me?
Kind regards and thanks upfront!
Rob
This is a Meteor issue not a testing issue :)
You need to put the SandwichesService on the global namespace. Your second block does that by default.
Try:
SandwichService = new SandwichesService()
(don't use var)
I would like to use a different base hub URL than ~/signalr/hubs. How to modify this url, for example to ~/api/hubs?
Second question, may I use a different url for a different sets of hubs? For example:
~/api/chat/hubs
~/api/email/hubs
Thanks.
Ran across this, possible now with 0.5+:
RouteTable.Routes.MapHubs("~/api");
No you may not, it's hardcoded in the source.
No the proxy generated is for all hubs.
Well this question is old (4 years? wtf.. I always thought web sockets was kinda new).
... Well they(Microsoft) have new descriptive well written documentation on their website now
This could be a link only answer but if you are in a hurry.... On the server side at the startup or owin app config have somthing like this...
app.MapSignalR("/newCoolUrl", new HubConfiguration());
Ehhh sure you need to replace everything "/signalr" on whichever clients you are using to "/newCoolUrl" example
var connection = $.hubConnection("/newCoolUrl", { useDefaultPath: false });