我正在按照此页面上的说明创建推送通知。我实际上之前已经做过一次并且能够让它工作(几周前),花了一些时间,并且认为我现在应该再次完成该教程作为复习,出于某种原因,我可以'甚至没有获取代码来点击 OnNewToken 方法来生成我的令牌并向通知中心注册设备。
我观看了数十个视频,阅读了其他教程,它们都在说/展示了几乎相同的内容,所以我认为我需要一双新的眼睛来向我展示我第二次错过的东西。
我尝试提取具体信息,但仍尽可能保持其可读性。
安装的 NuGet 包:
Android项目中的文件
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="(my firebase package / project package name)" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" />
<uses-permission android:name="android.permission.INTERNET" />
<!--
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
-->
<application>
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" android:exported="false" />
<receiver android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" 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="${applicationId}" />
</intent-filter>
</receiver>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
应用程序常量
public static class AppConstants …Run Code Online (Sandbox Code Playgroud) 顾名思义,我正在尝试执行我的Maven项目时生成JUnit结果的HTML报告。有人告诉我要检查maven-surefire-report插件,它看起来像我想要的东西,但似乎无法生成HTML文件。我希望仅生成HTML文件,然后可以将其放入老板的电子邮件中。我并不是真的想将结果发布到网站上(至少目前不是这样)。
这是我的pom部分看起来像的内容(不要担心缺少标签。我正在复制和粘贴相关部分,并尝试不粘贴公司信息,但知道我有正确的开始/结束标签):
编辑:添加了完整的pom。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myGroup</groupId>
<artifactId>myArtifact</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>myName</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sourceforge.jtds/jtds -->
<dependency>
<groupId>net.sourceforge.jtds</groupId>
<artifactId>jtds</artifactId>
<version>1.3.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>1.4.0.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.5</version>
</dependency> …Run Code Online (Sandbox Code Playgroud) 我刚开始使用spring-boot并且一直在不断地在构建我的项目方面取得进展但是我已经到了需要执行特定查询而不是Spring构建的查询的地步.
这是我的@Query的样子:
@Query("select top 1 * from 'table name' where 'column' like 'value' and message like 'value' order by 'column' desc")
Run Code Online (Sandbox Code Playgroud)
由于它与工作有关,我不得不更换我们的数据库特定信息,但我认为你们仍然应该能够了解我正在尝试做什么.我的老板想要这个查询,因为如果没有这样的格式,我们会返回很多结果,我们只想要最新的 - 因此是前1和顺序.
我看到的错误是"<operator>或AS预期,得到'1'",到目前为止,我还没有在Google上找到任何内容.
我在这做错了什么?
我在发送简单的 SOAP 请求并在我的 java 项目中获得响应时遇到问题。
我对通过 Java 执行此操作仍然很陌生,因此我一直在查看本教程,因为我还在项目的其余部分使用了 spring-boot。
目前我收到此错误(我确实必须删除细节,因为与公司相关并替换为通用字符串以便将它们粘贴在这里。我不得不删除我的实际 wsdl 和实际主机名):
[INFO] --- maven-jaxb2-plugin:0.12.3:generate (default) @ dcc-vm-validation ---
[INFO] Up-to-date check for source resources [[myWsdl, file:pom.xml]] and taret resources [[]].
[WARNING] The URI [myWsdl] seems to represent an absolute HTTP or HTTPS URL. Getting the last modification timestamp is only possible if the URL is accessible and if the server returns the [Last-Modified] header correctly. This method is not reliable and is likely to fail. In this …Run Code Online (Sandbox Code Playgroud) 我尝试按照此处的说明在通知点击上添加 MessagingCenter 订阅操作,以打开特定视图。我的发送/订阅在某个地方没有互相交谈,我只是看不到在哪里。消息中心的细节对我来说仍然是新的,所以我确信我只是在某个地方使用了错误的类或发送者。
下面的代码已根据链接中向我显示的内容进行了修改。但这个想法仍然大致相同。
这是我的FirebaseService类中的SendLocalNotification方法:
void SendLocalNotification(string body)
{
var intent = new Intent(this, typeof(MainActivity));
intent.AddFlags(ActivityFlags.SingleTop);
intent.PutExtra("OpenPage", "SomePage");
//Unique request code to avoid PendingIntent collision.
var requestCode = new Random().Next();
var pendingIntent = PendingIntent.GetActivity(this, requestCode, intent, PendingIntentFlags.OneShot);
var notificationBuilder = new NotificationCompat.Builder(this)
.SetContentTitle("Load Match")
.SetSmallIcon(Resource.Drawable.laundry_basket_icon_15875)
.SetContentText(body)
.SetAutoCancel(true)
.SetShowWhen(false)
.SetContentIntent(pendingIntent);
if (Build.VERSION.SdkInt >= BuildVersionCodes.O)
{
notificationBuilder.SetChannelId(AppConstants.NotificationChannelName);
}
var notificationManager = NotificationManager.FromContext(this);
notificationManager.Notify(0, notificationBuilder.Build());
}
Run Code Online (Sandbox Code Playgroud)
这是android MainActivity中的OnNewIntent方法:
protected override void OnNewIntent(Intent intent)
{
if (intent.HasExtra("OpenPage")) …Run Code Online (Sandbox Code Playgroud)