Create different MSIX installers using a flag parameter on a .NET MAUI app - maui

I want to automatically create different MSIX packages/installers for the same MAUI app, so that each one runs a specific code snippet according to a flag parameter.
The user does not have to interact with the app. An installer per flag value has to be created, an once the app is installed and the user double clicks the app icon, the specific piece of code has to be run.
So far, I've tried without success the following approach, trying to create a script that passes the possible values of the flag as installation parameters using the app installer and a protocol, and then trying to publish the different packages in a local path.
I would like to know whether that's feasible or there may be any other approach to get it done.

You can check this comment about .NET MAUI Windows target publishing/archiving.
In the article, the right way to set the MSIX is that you had to create a self-signed certificate and then You could add a couple of extra parameters to also add the sign the MSIX and then trust that cert manually.

Related

Google Actions CLI 3.1.0 version and actions.intent.TEXT

I want to be able to talk with Google Assistant, but connect the Actions project directly to an NLP service I already have running on my server. In other words, NOT use dialogflow.
All the following examples show how to do this.
With Rasa
https://blog.rasa.com/going-beyond-hey-google-building-a-rasa-powered-google-assistant/
With LUIS
https://www.grokkingandroid.com/using-the-actions-sdk/
https://dzone.com/articles/using-the-actions-sdk-for-google-assistant-develop
With Watson
https://www.youtube.com/watch?v=no0R0bSkHXc
They use the actions.intent.MAIN as the invocation and actions.intent.TEXT for all other utterances from the talker.
This is what I need. I don’t want to create a load of intents, with utterance phrases, inside the Action because I just want all the phrases spoken by the talker to be passed to my server, and for my NLP service to deal with them.
So I set up a new Action project, install the Actions CLI and then spend 3 days trying all possible combinations without success, because all these examples are using gactions cli 2.1.3 and Google have now moved on to gactions cli 3.1.0.
Not only have the commands changed, but so too has the file formats and structure.
It appears there is also a new Google Actions Console, and actions.intent.TEXT is no longer available.
My Action is webhook connected to my server, but I cannot figure out how to get the action.intent.TEXT included and working.
Everything I find, even here
Publishing Actions on google without Dialogflow
is pre version update and follows the same pattern.
Can anyone point to an up-to-date, v3.1.0, discussion, tutorial or example about how to send all talker phrases through to an NLP that isn’t dialogflow, or has Google closed that avenue?
Is it possible to somehow go back and use the 2.1 CLI either with the new Console or revert the console back. (I have both CLI versions, I can see how different their commands are)
Is it possible to go back and use 2.1?
There is no way to go back to AoG 2. You probably also don't want to do so - newer features aren't available with v2 and are only available with v3.
Can I use my own NLP with v3?
Yes, although it isn't as obvious, and there are some changes in semantics.
As an overview, what you'll need to do is:
Create a Type that can accept "Free form text". I usually call this type "Any".
In the console, it looks something like this:
Create a Custom Intent that has a single parameter of this Any Type and at least one phrase that captures everything for this parameter. (So you should add one training phrase, highlight the entire phrase, and set it for the parameter. Sometimes I also add additional phrases that includes words that I don't want to capture.) I usually call the Intent "matchAny" and the parameter "any".
In the console, it could be something like this:
Finally, you'll have a Scene that you transition to from the Main invocation. When it matches the "matchAny" Intent, it should call your webhook with a handler name. Your webhook will be called with the "any" parameter set with the user utterance. (Note that the JSON has also changed.
Again, the console might have it looking something like this:
That seems like a lot of work. Isn't there just some way to do all that from the command line?
Yes. You can do all of that in the configuration files that the CLI accesses and then upload it. (You can then also use the console to review the configuration, if necessary, to make sure they're configured as you expect. You can shift back and forth between them as appropriate.)
Google also has a github repository that contains most of the files pre-configured for this sort of setup.
You will need to update the configuration from the repository to handle the webhook correctly (it includes code to illustrate what is happening using the inline code editor) and to add your project ID.

Flutter - how to create a framework where i can have Debug and Prod versions where debug version has some way to choose test environment

I need to create two different versions of the app.
- debug
-prod
for debug, version i need user to select the test environment before anything else begins. i need some way to know what environment user has selected and then load API endpoints config file accordingly.
what's the best way to handle this in flutter?
I have seen in some apps that for iOS, debug options are available in app settings under the standard iOS settings menu , select the app and then see those options in there.
You might want to use Flutter Flavours. As the name suggests, you can practically make flavours of the same app based on your need - debug, test, production etc. And not only API end-points, but you can also configure everything else such as app icon, different labels on the screen etc.
As suggested in this link, you can have different main.dart file for each flavour. You can read different configuration from JSON file (such as API end-point) and rest of your app will remain same. For example, see below :
This is another helpful link.

Is there a way to execute google apps script from PostgreSQL or from Bash?

I have hundreds of google spreadsheets which all have the same script in them. I'd like to execute a specific google spreadsheet by ID either from PostgreSQL or from Bash. Is there an easy way to execute scripts? I prefer not having to learn python.
For example, I have spreadsheet id 1HGo8V-P5S-z4oCUiAKULrkZRFlzRHEalJqUFLiP and I'd like to execute function Refresh() via Bash or Postgresql.
Is the API the only route? https://developers.google.com/apps-script/api/how-tos/execute
So far my consideration is to create a python executable and execute it from a postgresql function. https://developers.google.com/apps-script/api/quickstart/python
Edit: It looks like if I want to execute any app script, each spreadsheet would need a google project (manually created). There has to be an easier way to do this, manually creating a project for every spreadsheet doesn't make sense.
Reference: https://developers.google.com/apps-script/api/how-tos/execute
The script being called and the calling application must share a Cloud
Platform project.
Solution:
Deploy web apps is the solution I ended up going with thanks to #Tanaike
You want to execute the container-bound script of Spreadsheet.
You want to execute the script from local PC or outside of Google.
You want to execute the script from Spreadsheet ID.
If my understanding is correct, how about this answer?
Retrieving project IDs of container bound script:
I think that this is the difficult problem in your situation. In the current stage, there are no methods for retrieving the project ID of the container-bound script from the parent Google Docs (in this case, it's Spreadsheet.).
This has already been reported at https://issuetracker.google.com/issues/111149037 as a Feature Request. But unfortunately, this has not been achieved yet.
By this, the project IDs are required to be retrieved manually.
For example, you can retrieve the project IDs at Developer Hub.
When you select a project, you can see the project ID at the URL of https://script.google.com/home/projects/### projectId ###.
From above situation, the project IDs are required to be manually retrieved from each Spreadsheet you want to run the script. I apologize that I couldn't find a workaround for this situation.
Executing script:
I think that there are 2 patterns for executing the script. You can select from 2 patterns.
1. Use the method of scripts.run in Apps Script API
This is also mentioned in your question.
Function in the script is execute using API.
You are required to create only python script at local side.
In this case, the access token retrieved by the OAuth2 process is required at local side.
I think that in this pattern, the script can be simple.
2. Use Web Apps
By accessing to Web Apps, function in the script is execute.
In this case, in order to execute the script, it uses scripts.run in Apps Script API, because of large number of Spreadsheets in your situation. When user accesses to Web Apps, the script of Spreadsheet is executed by the script of Web Apps. Because Google Apps Script is used, the access token can be easily retrieved.
You are required to create a python script for accessing to Web Apps at local side, and Google Apps Script at Google Side (Web Apps).
In this case, you can run the script with and without the access token at local side.
I think that in this pattern, the method of access can be simple.
References:
scripts.run method
Web Apps
Taking advantage of Web Apps with Google Apps Script
If this was not what you want, I apologize.
Edit:
From the discussions, I thought that in the case of your script Refresh(), the following flow is suitable.
1. Deploy Web Apps using the script of Refresh() like an API.
2. Call the API using python script and curl.
By this, the script of Web Apps is run and you can reflect the result of Refresh() for all Spreadsheets.
Sample script:
function doGet() {
var spreadsheets = ["spreadsheetId1", "spreadsheetId2",,,]; // Please set spreadsheet ID here.
for (var i = 0; i < spreadsheets.length; i++) {
SpreadsheetApp.openById(spreadsheets[i])
.getSheetByName("Sheet1") // If you want to also put values to other sheet, please modify this.
.getRange(1, 1)
.setValue(new Date());
}
return ContentService.createTextOutput("Done.");
}
When Web Apps is deployed, the authorization screen is opened. But this authorization is only one time.
Deploy Web Apps:
Before you request to Web Apps, please deploy Web Apps.
On the Script Editor
Publish -> Deploy as Web App
Create new Project version
At "Execute the app a"s, select "Me"
At "Who has access to the app", select "Anyone, even anonymous"
Click "Deploy"
Copy "Current web app URL"
Click "OK"
Curl sample:
If you use curl command, please use as follows.
$ curl -L "https://script.google.com/macros/s/#####/exec"
Note:
When you modified the script, please redeploy Web Apps as new version. By this, the latest script is reflected to Web Apps. This is an important point.
Note:
Also you can use the spreadsheet IDs for requesting and you can directly includ them in Web Apps. (In the sample script, the latter is used.)
If you want to use the spreadsheet IDs for requesting, please be careful. The number of workers for Web Apps is required to be less than 30. Ref

Bluemix DEA->Diego How can I handle the rename of VCAP_APP_PORT AND VCAP_APP_HOST without changing application code?

I have tested a few apps with enable-diego on Bluemix. They all broke because of this change. I could fix most, one I'm still struggling with. And none of which I actually wanted to make code changes in.
Instead of code changes being required to my apps, can I automate the mapping of the variables at container level (or any other solution)?
Not tried this but maybe you could create a user provided environment variable and set
VCAP_APP_PORT = $PORT
edit:
You can set user-provided environment variables using the Bluemix UI or using the cf set-env command.

How To Build and Compile PJSIP for Xcode, Using sample code IPJSUA to test?

How to build and compile PJSIP using xCode and run the sample code IPJSUA?
First, you need to open the terminal. Terminal can be found at Applications->Utilities->terminal.
After you open the terminal, make sure you point to the desktop to make it easier to get the data folder. just type :
cd Desktop
Congrats, you already at your desktop. Now continue to type this.
svn co http://svn.pjsip.org/repos/pjproject/trunk pjproject
That code means you download the pjproject from the website to your desktop. After you finish download the PJSIP, you need to add a config_site.h. Honestly, I don't what should we do that, but just follow it. :D
How do you create a config_site.h? Just copy the config_site_sample.h, paste, and change the content become like this.
After this, we need to change the configure-iphone. I figured it out. If you just want to run at simulator you need to change the DevPath. If you want to test on device, just leave it be.
Now, I will give example to run on the Simulator. Open pjproject and you will find the configure-iphone. Open the file using a text editor and change the DEVPATH and hardcode the IPHONESDK.
The devpath will looks like this.
DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer
Remember, this refers to the path to your Xcode app. If you want to make sure, go to finder->applications->xcode->show package contents. I also hardcoded the IPHONESDK.
IPHONESDK=iPhoneSimulator5.1.sdk
After you're done with that, we will going back to the terminal. Make sure you already at the pjproject folder. Type this.
export CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc
export CFLAGS="-O2 -m32 -miphoneos-version-min=5.0 -g -ggdb -g3 -DNDEBUG"
export LDFLAGS="-O2 -m32"
After that, you can configure it. Just click this on terminal. If you want to test on your device, you don't need to change the configure-iphone, export CC, etc., just directly configure-iphone.
./configure-iphone
After you're done, continue by entering the commands below to build the library and all dependencies. This line below is where the magic happens and it needs to complete successfully for you to continue.
make dep && make clean && make
You will find that all the libraries will compile. The resulting library can help us if we want to create a new project. -> this is what I'm thinking right now.
Now you almost finished, just go to the pjsip-apps->src->ipjsua. You will find the Xcode project, just click it to open at your xcode. Click build and run. You will find the interface like this.
If you want to test on your device, you must have the certificate and private key chain. I can't explain that because I got that certificate from my company. They provide it.
If you want to try, you must create a SIP account first. You can use sip2sip or ekiga. At here I tried ekiga. for example my SIP is 12345678#ekiga.net and 87654321#ekiga.net.
After the simulator we key in +a to add new account.
Next you will have to type your SIP name. remember to type "sip:". dont ever forget. here is the example:sip:12345678#ekiga.net.
After that you will have to type the URL address, just type ekiga.net since that is our URL. This URL means our server. Tor example, sip:ekiga.net.
Next is the auth realm. Type the same as the URL address, sip:ekiga.net.
Next is your username. In here my username is 12345678. You don't need to add sip or type with #ekiga.net.
Last is your password. After you register, it will automatically add it to the account. Just go to the textfield, and hit enter. It will refresh for you.
Next, we need to add buddy. Type +b, and you must input the URI address. Type sip:87654321#ekiga.net and you are done. Back to the textfield, it will add automatically to your buddy list.
You will see that your account still in offline mode. You need to change into online mode before you make a call. Just change the status by type t, and hit enter.
After that you can make a call by type M. and type 1. because our buddy is no 1. 1 is their ID. and you can make a call.
Please check below link. You can get source code from there and biuld for both device and simulator.
https://github.com/radif/SIPHON-SIP-Client-that-actually-compiles
For XCode 4.5
->
export DEVPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/
export IPHONESDK=iPhoneSimulator5.1.sdk
export CC=/Applications/Xcode.app/Contents/Developer/usr/bin/gcc