how to coding a electron notification by toastxml - electron

let notice = new Notification({
toastXml: `
<toast>
<visual>
<binding template="ToastText01">
<text id="1">窗口内容</text>
<text id="2">窗口内容</text>
</binding>
</visual>
<actions>
<action content="Count up" activationType="protocol" arguments="myapp://contentId=351" />
<action content="Count down" activationType="protocol" arguments="myapp://params=remindlater&contentId=351" />
</actions>
</toast>`
})
notice.show()
1、The content of the template must start with ToastText
2、when I want to write multiple lines of content, the text must use the same ID, up to three lines
3、
Who can provide a toast xml document of electric notification, or give a case

Related

Outlook Web Add-in MVC -> Call Controller in TaskPane

i am trying to develop an outlook web mvc addin with visual studio 2017.
I successfully integrated my XML-Manifest, the ribbon button is added correctly and the task pane opens after clicking my button.
Anyway my view cannot be displayed!
My error message is the same as "Shyam sundar shah" got more than a year ago:
"Add-in error: Something went wrond and we couldn´t start this add-in. Please try again later or contact your system administrator."
Outlook web addin is not loading in Outlook webApps using MVC
I linked the question cause i am not able to link any images in my questions yet.
Here is my Extensionpoint in the manifest:
<ExtensionPoint xsi:type="MessageReadCommandSurface">
<OfficeTab id="ReadTab">
<Group id="ReadGroup">
<Label resid="ReadGroupLabel" />
<Control xsi:type="Button" id="msgReadOpenPaneButton">
<Label resid="ReadButtonLabel" />
<Supertip>
<Title resid="ReadSuperTipTitle" />
<Description resid="ReadSuperTipDescription" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon" />
<bt:Image size="32" resid="icon" />
<bt:Image size="80" resid="icon" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="ReadPane" />
</Action>
</Control>
<Control xsi:type="Button" id="msgReadOpenPaneButton2">
<Label resid="ReadButtonLabel2" />
<Supertip>
<Title resid="ReadSuperTipTitle2" />
<Description resid="ReadSuperTipDescription2" />
</Supertip>
<Icon>
<bt:Image size="16" resid="icon" />
<bt:Image size="32" resid="icon" />
<bt:Image size="80" resid="icon" />
</Icon>
<Action xsi:type="ShowTaskpane">
<SourceLocation resid="ReadPane2"/>
</Action>
</Control>
</Group>
</OfficeTab>
</ExtensionPoint>
<bt:Urls>
<bt:Url id="functionFile" DefaultValue="https://localhost:44302/Functions/FunctionFile.html"/>
<bt:Url id="ReadPane" DefaultValue="https://localhost:44302/Home/Login"/>
<bt:Url id="ReadPane2" DefaultValue="http://localhost:12543/Home/Login"/>
</bt:Urls>
As you can see i tried the SSL and the non SSL path. Both throw the same error.
My controller action is as simple as possible. I am just testing a local initialized variable of being true or false and in both cases i return the View with a correspondenting Model. So I dont think my problem is hiding there.(the cases will be completed later, cause there is no relation to my problem):
private bool _unconnect = false;
public ActionResult Login()
{
LoginModel model = new LoginModel();
if (!_unconnect)
{
return View(model);
}
else
{
return View(model);
}
}
I didn´t found any solution in the above linked question or anywhere else.
Are there any new cognitions for this error?
Thanks in advance.

Add Custom column to UI in TFS?

Here is how I added [AHA Reference] column (custom column) to my local TFS, which I learned from
https://learn.microsoft.com/en-us/vsts/work/customize/reference/witadmin/witadmin-import-export-manage-wits?view=tfs-2018
1) run below command to export the WIT
witadmin exportwitd /collection:http://XXXXX:8080/tfs/DefaultCollection /p:LocalTestProject /f:c:\temp\myworkitems_local.xml /n:Feature
2) In the generated xml file, I added this to the FIELDS node
3) then I added a Control node under FORM
4) then in the TFS, I added [AHA Reference] column, and I can see it in the list.
5) Since I added control in step 3, my understanding is that in the detail popup, it should show the [AHA Reference] under ‘value area’. It never showed up. But, the [AHA Reference] field is added and I can retrieve it from code.
Maybe my understanding is not correct. Not an important question. I’m just curious what that ‘Control’ node in WIT does if not adding the ‘control’ to UI.
Thanks
It's because you added the Control under the old form/team explorer in step 3. If you back to old form, you'll see this field. In order to make the Control shows in new web form, you need to add the control under <FORM><WebLayout>...</WebLayout></FORM>:
<FORM>
<WebLayout>
<Page Label="Details" LayoutMode="FirstColumnWide">
<Section>
<Group Label="Details">
<Control Label="Priority" Type="FieldControl" FieldName="Microsoft.VSTS.Common.Priority" />
<Control Label="Effort" Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.Effort" />
<Control Label="Business Value" Type="FieldControl" FieldName="Microsoft.VSTS.Common.BusinessValue" />
<Control Label="Time Criticality" Type="FieldControl" FieldName="Microsoft.VSTS.Common.TimeCriticality" />
<Control Label="Value area" Type="FieldControl" FieldName="Microsoft.VSTS.Common.ValueArea" />
<Control Label="AHA Reference" Type="FieldControl" FieldName="AHAReference.AHAReference" />
</Group>
</Section>
</Page>
</WebLayout>
</FORM>
Useful links:
https://learn.microsoft.com/en-us/vsts/work/customize/customize-wit-form?view=vsts
https://learn.microsoft.com/en-us/vsts/work/customize/reference/weblayout-xml-elements?view=vsts

TFS 2017 WITD Import error VS403073

While importing a newly customized Work Item Type Definition into TFS 2017.3, I am receiving the error:
VS403073: Group {GroupName} violates the rule that a group can only
contain a single HTML or WebPage control preceded by label controls.
My question is three-fold:
1) Where are these styling/schema rules documented? I was unable to find any information on this, or any other schema rule, on Microsoft's site here.
2) I am trying to keep several FieldControls and a single HTMLFieldControl grouped together under one heading on the WebForm for organization purposes. Why would there be a rule put in place to prevent this type of organization?
3) Is it possible to, and what would be the consequences of, bypassing this rule and importing the WITD anyway?
Please let me know if any further information/clarification is needed.
Edit:
Psudo code would be something to this effect:
<WebLayout>
...
<Page>
<Section>
<Group Label="Group 1">
<Control type="FieldControl" Label="G1C1" FieldName="X.G1Field1" />
<Control type="FieldControl" Label="G1C2" FieldName="X.G1Field2" />
<Control type="FieldControl" Label="G1C3" FieldName="X.G1Field3" />
<Control type="HTMLFieldControl" Label="G1C4" FieldName="X.G1Field4" />
</Group>
</Section>
</Page>
</WebLayout>
I ran into this as well. I moved the HTMLFieldControl to its own group and that resolved the issue.
Example from Microsoft's documentation
Error:
<Section>
<Group Label="Description:">
<Control Label="Reason For Request:" Type="HtmlFieldControl" FieldName="System.Description" />
<Control Label="Business Case For Request:" Type="HtmlFieldControl" FieldName="MB.BusinessCase" />
</Group>
</Section>
Resolution:
<Section>
<Group Label="Reason for Request">
<Control Label="Reason For Request:" Type="HtmlFieldControl" FieldName="System.Description" />
</Group>
<Group Label="Business Case">
<Control Label="Business Case For Request" Type="HtmlFieldControl" FieldName="Custom.BusinessCase" />
</Group>
</Section>
Documentation can be found HERE

GCM in Delphi Seattle without BAAS

I am trying to implement GCM without BAAS in GCM. I have looked at previous examples using the bridge and from my research the following should work without relying on the old TGCMReceiver component.
But the following line always returns nil, I run this after the application starts up on a button click:
APushService := TPushServiceManager.Instance.GetServiceByName(TPushService.TServiceNames.GCM);
APushService is always nil.
My AndroidManifest looks as follows:
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.embarcadero.Project1"
android:versionCode="1"
android:versionName="1.0.0"
android:installLocation="auto">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<permission android:name="com.embarcadero.Project1.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.embarcadero.Project1.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature android:glEsVersion="0x00020000" android:required="True"/>
<application android:persistent="False"
android:restoreAnyVersion="False"
android:label="Project1"
android:debuggable="True"
android:largeHeap="False"
android:icon="#drawable/ic_launcher"
android:theme="#style/AppTheme"
android:hardwareAccelerated="true">
<meta-data android:name="com.google.android.gms.version" android:value="4323000" />
<!-- Our activity is a subclass of the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="com.embarcadero.firemonkey.FMXNativeActivity"
android:label="Project1"
android:configChanges="orientation|keyboard|keyboardHidden|screenSize"
android:launchMode="singleTask">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="Project1" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<receiver
android:name="com.embarcadero.gcm.notifications.GCMNotification" android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.embarcadero.Project1" />
</intent-filter>
</receiver>
<receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" />
<receiver android:exported="true" android:name="com.embarcadero.gcm.notifications.GCMNotification" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.embarcadero.Project1" />
</intent-filter>
</receiver>
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />
</application>
</manifest>
<!-- END_INCLUDE(manifest) -->
I have tried using the common TGCMReceiver application that is out there from CodeRage9 using XE8, it doesn't work in XE10 / Seattle and it does appear that XE10 is updated in this regard but I cannot make anything work with simple Google Cloud Messaging and am looking for some guidance.
The answer is shown here: Issue with GCM Push notification service DELPHI XE6
Except with .Active := True not AutoActivate := True as indicated by the Answer.
TL;DR version. Drop TKinvyProvider on form with just the GCMAppID populated, Drop TPushEvent on Form with AutoRegister and AutoActivate set to false. In entitlement list set "support push notification : true".. add in the following to your AndroidManifest.template.xml:
<service android:name="com.embarcadero.gcm.notifications.GCMIntentService" />
Right before </application>.

Push Notifications for Android app using Trigger.io and Parse are not working

Push Notifications for my Android app using Trigger.io and Parse are not working. Everything seems to be set up correctly in Parse and Trigger, Parse says the pushes are going through but the phone never receives them regardless if the app is open or not. I have another part of the app that successfully uploads photos to Parse and uses the REST API to pull them back down and I see my single installation in the dashboard assigned to my beta channel. Neither the Broadcast nor the specific channel seems to work. I'm just wondering if there is a setting on the device or in my config file that I need to switch to allow the push notifications to go through. All documentation I can find still references the forge.partners.parse functions which are no longer in use and the syntax seems to be a bit different around this functionality now. Any help is appreciated!!
I found something that could be a factor, my AndroidManifest seems to be missing a couple things that are show on the Parse documentation(here: https://parse.com/tutorials/android-push-notifications ), I can't directly edit this XML file because Trigger compiles it automatically so I'm not sure what I can do.
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="io.trigger.forge44c192547c6611e3b1811231392b77b0" android:installLocation="auto" android:versionCode="1391094815" android:versionName="0.1">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="15" />
<application android:icon="#drawable/icon" android:label="TheFireStore App" android:name="io.trigger.forge.android.core.ForgeApp">
<activity android:configChanges="mcc|mnc|locale|touchscreen|keyboardHidden|navigation|orientation|screenLayout|uiMode|fontScale|screenSize" android:launchMode="singleTask" android:name="io.trigger.forge.android.core.ForgeActivity" android:stateNotNeeded="true" android:theme="#android:style/Theme.Black.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="TheFireStore.com" />
</intent-filter>
</activity>
<provider android:authorities="io.trigger.forge44c192547c6611e3b1811231392b77b0" android:exported="true" android:name="io.trigger.forge.android.core.ForgeContentProvider" tools:ignore="ExportedContentProvider" />
<service android:name="com.parse.PushService" />
<receiver android:name="com.parse.ParseBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.USER_PRESENT" />
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.ACCESS_GPS" />
<uses-permission android:name="android.permission.ACCESS_ASSISTED_GPS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />

Resources