JLChen
2021-04-29 ca8861072840a863ab57fd8c29a8c0d0b1df7898
2021-04-29 1.Google Play极光推送库
15个文件已添加
2个文件已修改
781 ■■■■■ 已修改文件
.gitignore 215 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Additions/AboutAdditions.txt 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/JPushGP.Droid.csproj 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Jars/AboutJars.txt 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Jars/jcore-android-2.7.8-google_play.jar 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Jars/jpush-android-4.0.6-google_play.jar 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Libs/arm64-v8a/libjcore278.so 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Libs/armeabi-v7a/libjcore278.so 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Libs/armeabi/libjcore278.so 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Properties/AssemblyInfo.cs 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Transforms/EnumFields.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Transforms/EnumMethods.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
JPushGP.Droid/Transforms/Metadata.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
README.md 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Xamarin.Android集成参考/AndroidManifest.xml 131 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Xamarin.Android集成参考/JPush/JPushReceiver.cs 208 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Xamarin.Android集成参考/JPush/JPushService.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.gitignore
@@ -1,26 +1,189 @@
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Pods/
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
build/
bld/
[Bb]in/
[Oo]bj/
.vs/
packages/
.DS_Store
# Roslyn cache directories
*.ide/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
#NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
## TODO: Comment the next line if you want to checkin your
## web deploy settings but do note that will include unencrypted
## passwords
*.pubxml
# NuGet Packages
packages/*
*.nupkg
## TODO: If the tool you use requires repositories.config
## uncomment the next line
#!packages/repositories.config
# Enable "build/" folder in the NuGet Packages folder since
# NuGet packages use it for MSBuild targets.
# This line needs to be after the ignore of the build folder
# (and the packages folder if the line above has been uncommented)
!packages/build/
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
JPushGP.Droid/Additions/AboutAdditions.txt
New file
@@ -0,0 +1,48 @@
Additions allow you to add arbitrary C# to the generated classes
before they are compiled.  This can be helpful for providing convenience
methods or adding pure C# classes.
== Adding Methods to Generated Classes ==
Let's say the library being bound has a Rectangle class with a constructor
that takes an x and y position, and a width and length size.  It will look like
this:
public partial class Rectangle
{
    public Rectangle (int x, int y, int width, int height)
    {
        // JNI bindings
    }
}
Imagine we want to add a constructor to this class that takes a Point and
Size structure instead of 4 ints.  We can add a new file called Rectangle.cs
with a partial class containing our new method:
public partial class Rectangle
{
    public Rectangle (Point location, Size size) :
        this (location.X, location.Y, size.Width, size.Height)
    {
    }
}
At compile time, the additions class will be added to the generated class
and the final assembly will a Rectangle class with both constructors.
== Adding C# Classes ==
Another thing that can be done is adding fully C# managed classes to the
generated library.  In the above example, let's assume that there isn't a
Point class available in Java or our library.  The one we create doesn't need
to interact with Java, so we'll create it like a normal class in C#.
By adding a Point.cs file with this class, it will end up in the binding library:
public class Point
{
    public int X { get; set; }
    public int Y { get; set; }
}
JPushGP.Droid/JPushGP.Droid.csproj
New file
@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{7247C19B-8277-4695-A05D-9F3CDF14877F}</ProjectGuid>
    <ProjectTypeGuids>{10368E6C-D01B-4462-8E8B-01FC667A7035};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <TemplateGuid>{77efb91c-a7e9-4b0e-a7c5-31eeec3c6d46}</TemplateGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>JPushGP.Droid</RootNamespace>
    <AssemblyName>JPushGP.Droid</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <Deterministic>True</Deterministic>
    <TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
    <AndroidClassParser>class-parse</AndroidClassParser>
    <AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
    <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>portable</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>portable</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="Mono.Android" />
    <Reference Include="System" />
    <Reference Include="System.Core" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Jars\AboutJars.txt" />
    <None Include="Additions\AboutAdditions.txt" />
  </ItemGroup>
  <ItemGroup>
    <TransformFile Include="Transforms\Metadata.xml" />
    <TransformFile Include="Transforms\EnumFields.xml" />
    <TransformFile Include="Transforms\EnumMethods.xml" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedJar Include="Jars\jcore-android-2.7.8-google_play.jar" />
    <EmbeddedJar Include="Jars\jpush-android-4.0.6-google_play.jar" />
  </ItemGroup>
  <ItemGroup>
    <EmbeddedNativeLibrary Include="Libs\armeabi-v7a\libjcore278.so" />
    <EmbeddedNativeLibrary Include="Libs\arm64-v8a\libjcore278.so" />
    <EmbeddedNativeLibrary Include="Libs\armeabi\libjcore278.so" />
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.Bindings.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
JPushGP.Droid/Jars/AboutJars.txt
New file
@@ -0,0 +1,24 @@
This directory is for Android .jars.
There are 2 types of jars that are supported:
== Input Jar ==
This is the jar that bindings should be generated for.
For example, if you were binding the Google Maps library, this would
be Google's "maps.jar".
Set the build action for these jars in the properties page to "InputJar".
== Reference Jars ==
These are jars that are referenced by the input jar.  C# bindings will
not be created for these jars.  These jars will be used to resolve
types used by the input jar.
NOTE: Do not add "android.jar" as a reference jar.  It will be added automatically
based on the Target Framework selected.
Set the build action for these jars in the properties page to "ReferenceJar".
JPushGP.Droid/Jars/jcore-android-2.7.8-google_play.jar
Binary files differ
JPushGP.Droid/Jars/jpush-android-4.0.6-google_play.jar
Binary files differ
JPushGP.Droid/Libs/arm64-v8a/libjcore278.so
Binary files differ
JPushGP.Droid/Libs/armeabi-v7a/libjcore278.so
Binary files differ
JPushGP.Droid/Libs/armeabi/libjcore278.so
Binary files differ
JPushGP.Droid/Properties/AssemblyInfo.cs
New file
@@ -0,0 +1,26 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle ("JPushGP.Droid")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("JPushGP.Droid")]
[assembly: AssemblyCopyright ("Copyright Â©  2021")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
[assembly: ComVisible (false)]
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
[assembly: AssemblyVersion ("1.0.1.0")]
[assembly: AssemblyFileVersion ("1.0.1.0")]
JPushGP.Droid/Transforms/EnumFields.xml
New file
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<enum-field-mappings>
    <!--
  This example converts the constants Fragment_id, Fragment_name,
  and Fragment_tag from android.support.v4.app.FragmentActivity.FragmentTag
  to an enum called Android.Support.V4.App.FragmentTagType with values
  Id, Name, and Tag.
  <mapping jni-class="android/support/v4/app/FragmentActivity$FragmentTag" clr-enum-type="Android.Support.V4.App.FragmentTagType">
    <field jni-name="Fragment_name" clr-name="Name" value="0" />
    <field jni-name="Fragment_id" clr-name="Id" value="1" />
    <field jni-name="Fragment_tag" clr-name="Tag" value="2" />
  </mapping>
  -->
</enum-field-mappings>
JPushGP.Droid/Transforms/EnumMethods.xml
New file
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<enum-method-mappings>
    <!--
  This example changes the Java method:
    android.support.v4.app.Fragment.SavedState.writeToParcel (int flags)
  to be:
    android.support.v4.app.Fragment.SavedState.writeToParcel (Android.OS.ParcelableWriteFlags flags)
  when bound in C#.
  <mapping jni-class="android/support/v4/app/Fragment.SavedState">
    <method jni-name="writeToParcel" parameter="flags" clr-enum-type="Android.OS.ParcelableWriteFlags" />
  </mapping>
  -->
</enum-method-mappings>
JPushGP.Droid/Transforms/Metadata.xml
New file
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
    <!--
  This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
  <remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
  This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
  <remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
  -->
</metadata>
README.md
@@ -2,3 +2,9 @@
Google Play极光推送库
    //设置极光调试模式,为false时只打印警告信息
     CN.Jpush.Android.Api.JPushInterface.SetDebugMode(false);
     CN.Jpush.Android.Api.JPushInterface.Init (this);
    //其它参考Xamarin.Android集成参考里面文件
Xamarin.Android¼¯³É²Î¿¼/AndroidManifest.xml
New file
@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202104011" android:versionName="1.2.202104011" package="com.hdl.onpro">
    <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" />
    <!--  å¯è§†å¯¹è®²æƒé™-->
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <!--  å®šä½æƒé™-->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <!--  æ‹ç…§æƒé™ -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <!-- åœ¨å®‰å“P版本之后,必须要授予FOREGROUND_SERVICE权限,才能够使用前台服务 -->
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <!--  æ’­æ”¾æœ¬åœ°éŸ³ä¹æƒé™-->
    <uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <!--极光推送 Required  ä¸€äº›ç³»ç»Ÿè¦æ±‚的权限,如访问网络等-->
    <!-- Required  ä¸€äº›ç³»ç»Ÿè¦æ±‚的权限,如访问网络等-->
    <permission android:name="com.hdl.onpro.permission.JPUSH_MESSAGE" android:protectionLevel="signature" />
    <!-- Required -->
    <uses-permission android:name="com.hdl.onpro.permission.JPUSH_MESSAGE" />
    <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_LOGS" />
    <!-- æžå…‰æŽ¨é€ç»“束 -->
    <application android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="ON+">
        <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.onpro.fileProvider" android:grantUriPermissions="true" android:exported="false">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
        </provider>
        <!--极光推送-->
        <!-- Required SDK æ ¸å¿ƒåŠŸèƒ½-->
        <!-- å¯é…ç½® android:process å‚æ•°å°† PushService æ”¾åœ¨å…¶ä»–进程中 -->
        <service android:name="cn.jpush.android.service.PushService" android:enabled="true" android:exported="false">
            <intent-filter>
                <action android:name="cn.jpush.android.intent.REGISTER" />
                <action android:name="cn.jpush.android.intent.REPORT" />
                <action android:name="cn.jpush.android.intent.PushService" />
                <action android:name="cn.jpush.android.intent.PUSH_TIME" />
            </intent-filter>
        </service>
        <!-- since 3.0.9 Required SDK æ ¸å¿ƒåŠŸèƒ½-->
        <provider android:authorities="com.hdl.onpro.DataProvider" android:name="cn.jpush.android.service.DataProvider" android:exported="true" />
        <!-- since 1.8.0 option å¯é€‰é¡¹ã€‚用于同一设备中不同应用的 JPush æœåŠ¡ç›¸äº’æ‹‰èµ·çš„åŠŸèƒ½ã€‚ -->
        <!-- è‹¥ä¸å¯ç”¨è¯¥åŠŸèƒ½å¯åˆ é™¤è¯¥ç»„ä»¶ï¼Œæˆ–æŠŠ enabled è®¾ç½®æˆ false ï¼›App ä¸ä¼šè¢«å…¶ä»– App æ‹‰èµ·ï¼Œä½†ä¼šæ‹‰èµ·å…¶ä»–çš„ App。 -->
        <service android:name="cn.jpush.android.service.DaemonService" android:enabled="false" android:exported="true">
            <intent-filter>
                <action android:name="cn.jpush.android.intent.DaemonService" />
                <category android:name="com.hdl.onpro" />
            </intent-filter>
        </service>
        <!-- since 3.1.0 Required SDK æ ¸å¿ƒåŠŸèƒ½-->
        <provider android:authorities="com.hdl.onpro.DownloadProvider" android:name="cn.jpush.android.service.DownloadProvider" android:exported="true" />
        <!-- Required SDK æ ¸å¿ƒåŠŸèƒ½-->
        <receiver android:name="cn.jpush.android.service.PushReceiver" android:enabled="true">
            <intent-filter android:priority="1000">
                <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED_PROXY" />
                <category android:name="com.hdl.onpro" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.USER_PRESENT" />
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            </intent-filter>
            <!-- Optional -->
            <intent-filter>
                <action android:name="android.intent.action.PACKAGE_ADDED" />
                <action android:name="android.intent.action.PACKAGE_REMOVED" />
                <data android:scheme="package" />
            </intent-filter>
        </receiver>
        <!-- Required SDK æ ¸å¿ƒåŠŸèƒ½-->
        <!-- è‹¥æ‚¨çš„业务中有使用极光富媒体功能,或者极光早上好功能,需要把此 Activity çš„ exported è®¾ç½®æˆ true。 -->
        <activity android:name="cn.jpush.android.ui.PushActivity" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar" android:exported="false">
            <intent-filter>
                <action android:name="cn.jpush.android.ui.PushActivity" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.hdl.onpro" />
            </intent-filter>
        </activity>
        <!-- SDK æ ¸å¿ƒåŠŸèƒ½-->
        <!-- è‹¥æ‚¨çš„业务中有使用极光富媒体功能,或者极光早上好功能,需要把此 Activity çš„ exported è®¾ç½®æˆ true。 -->
        <activity android:name="cn.jpush.android.ui.PopWinActivity" android:configChanges="orientation|keyboardHidden" android:exported="false" android:theme="@style/MyDialogStyle">
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="com.hdl.onpro" />
            </intent-filter>
        </activity>
        <!-- since 3.6.0 -->
        <activity android:name="cn.jpush.android.service.DActivity" android:enabled="true" android:exported="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:taskAffinity="jpush.custom">
            <intent-filter>
                <action android:name="cn.jpush.android.intent.DActivity" />
                <category android:name="com.hdl.onpro" />
            </intent-filter>
        </activity>
        <!-- Required SDK æ ¸å¿ƒåŠŸèƒ½-->
        <receiver android:name="cn.jpush.android.service.AlarmReceiver" />
        <!-- 3.5.0新增,用于定时展示功能 -->
        <receiver android:name="cn.jpush.android.service.SchedulerReceiver" android:exported="false" />
        <!--Required SDK核心功能 since 3.3.0-->
        <activity android:name="cn.jpush.android.service.JNotifyActivity" android:exported="true" android:taskAffinity="jpush.custom" android:theme="@android:style/Theme.Translucent.NoTitleBar">
            <intent-filter>
                <action android:name="cn.jpush.android.intent.JNotifyActivity" />
                <category android:name="com.hdl.onpro" />
            </intent-filter>
        </activity>
        <!-- Required. For publish channel feature -->
        <!-- JPUSH_CHANNEL æ˜¯ä¸ºäº†æ–¹ä¾¿å¼€å‘者统计 APK åˆ†å‘渠道。-->
        <!-- ä¾‹å¦‚: -->
        <!-- å‘到 Google Play çš„ APK å¯ä»¥è®¾ç½®ä¸º google-play; -->
        <!-- å‘到其他市场的 APK å¯ä»¥è®¾ç½®ä¸º xxx-market。 -->
        <meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" />
        <!-- Required. AppKey copied from Portal -->
        <meta-data android:name="JPUSH_APPKEY" android:value="cbd90743ac45cbca06c8118b" />
        <!-- æžå…‰æŽ¨é€ç»“束 -->
    </application>
</manifest>
Xamarin.Android¼¯³É²Î¿¼/JPush/JPushReceiver.cs
New file
@@ -0,0 +1,208 @@

using System;
using Android.Content;
using CN.Jpush.Android.Api;
using CN.Jpush.Android.Service;
using HDL_ON;
using HDL_ON.DAL.Server;
using Shared;
namespace HDL_ON_Android
{
    [BroadcastReceiver(Enabled = true, Exported = false)]
    [Android.App.IntentFilter(new string[]
    {
        "cn.jpush.android.intent.RECEIVE_MESSAGE"
    },
    Categories=new string[]
    {
        "com.hdl.onpro"
    })]
    public class JPushReceiver : JPushMessageReceiver
    {
        private static string TAG = "JPushReceiver";
        /// <summary>
        /// ç”¨æˆ·ç‚¹å‡»æ‰“开了通知
        /// ç‚¹å‡»é€šçŸ¥å›žè°ƒ
        /// </summary>
        /// <param name="context"></param>
        /// <param name="notificationMessage"></param>
        public override void OnNotifyMessageOpened(Context context, NotificationMessage notificationMessage)
        {
            //2020-12-23 è§£å†³ç‚¹å‡»é€šçŸ¥æ æ‰“开不了APP问题
            //base.OnNotifyMessageOpened(context, notificationMessage);
            OpenNotification(context, notificationMessage);
        }
        /// <summary>
        /// æ”¶åˆ°é€šçŸ¥å›žè°ƒ
        /// </summary>
        /// <param name="p0"></param>
        /// <param name="p1"></param>
        public override void OnNotifyMessageArrived(Context context, NotificationMessage notificationMessage)
        {
            base.OnNotifyMessageArrived(context, notificationMessage);
            var pushMes = new JPushMessageInfo()
            {
                Title = notificationMessage.NotificationTitle,
                Content = notificationMessage.NotificationContent,
                Extras = notificationMessage.NotificationExtras
            };
            var jpushExpandData = GetJPushExpandData(pushMes);
            if (jpushExpandData != null && jpushExpandData.messageType != null)
            {
                pushMes.messageType = jpushExpandData.messageType;
                pushMes.expantContent = jpushExpandData.expantContent;
                Utlis.WriteLine("PushMes messageType : " + pushMes.messageType);
            }
            Utlis.WriteLine("PushMes title : " + pushMes.Title);
            Utlis.WriteLine("PushMes message : " + pushMes.Content);
            Utlis.WriteLine("PushMes extras : " + pushMes.Extras);
            Shared.Application.RunOnMainThread(() =>
            {
                HDLCommon.Current.AdjustPushMessage(pushMes);
            });
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="pushMes"></param>
        /// <returns></returns>
        ExpandData GetJPushExpandData(JPushMessageInfo pushMes)
        {
            try
            {
                if (pushMes.Extras != null)
                {
                    var jpushExpandData = Newtonsoft.Json.JsonConvert.DeserializeObject<JPushExpandData>(pushMes.Extras.ToString());
                    return Newtonsoft.Json.JsonConvert.DeserializeObject<ExpandData>(jpushExpandData.expandData);
                }
                return null;
            }
            catch
            {
                return null;
            }
        }
        /// <summary>
        /// æ³¨å†ŒæˆåŠŸå›žè°ƒ
        /// </summary>
        /// <param name="p0"></param>
        /// <param name="p1"></param>
        public override void OnRegister(Context context, string p1)
        {
            base.OnRegister(context, p1);
            Utlis.WriteLine("JPushOnRegister: " + p1);
        }
        ///// <summary>
        ///// å¤„理极光信息推送
        ///// </summary>
        ///// <param name="title">标题</param>
        ///// <param name="message">信息</param>
        ///// <param name="extras">负载数据</param>
        //public void AdjustJiguangMsgPush(JPushMessageInfo JPushMessageInfo)
        //{
        //    try
        //    {
        //        if (JPushMessageInfo.Extras.Contains("Offline") == true)
        //        {
        //            Shared.Application.RunOnMainThread(() =>
        //            {
        //                //账号在别处登陆,被踢下线 è·³è½¬åˆ°ç™»å½•页面
        //                new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
        //                //2020-12-04 å¾…增加退出登录操作
        //            });
        //            return;
        //        }
        //        else
        //        {
        //            Shared.Application.RunOnMainThread(() =>
        //            {
        //                new Alert(JPushMessageInfo.Title, JPushMessageInfo.Content, Language.StringByID(StringId.Close)).Show();
        //            });
        //            return;
        //        }
        //    }
        //    catch
        //    {
        //    }
        //}
        /// <summary>
        /// æ‰“开消息显示界面.010000
        /// </summary>
        /// <param name="context"></param>
        /// <param name="notificationMessage"></param>
        private void OpenNotification(Context context, NotificationMessage notificationMessage)
        {
            try
            {
                var pushMes = new JPushMessageInfo()
                {
                    Title = notificationMessage.NotificationTitle,
                    Content = notificationMessage.NotificationContent,
                    Extras = notificationMessage.NotificationExtras
                };
                var jpushExpandData = GetJPushExpandData(pushMes);
                if (jpushExpandData != null && jpushExpandData.messageType != null)
                {
                    pushMes.messageType = jpushExpandData.messageType;
                    pushMes.expantContent = jpushExpandData.expantContent;
                    Utlis.WriteLine("PushMes messageType : " + pushMes.messageType);
                }
                Utlis.WriteLine("PushMes title : " + pushMes.Title);
                Utlis.WriteLine("PushMes message : " + pushMes.Content);
                Utlis.WriteLine("PushMes extras : " + pushMes.Extras);
                Shared.Application.RunOnMainThread(() =>
                {
                    Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( èµ·å§‹ç»„件对象 , ç›®æ ‡ Service.class);
                    i.SetFlags(ActivityFlags.NewTask);
                    context.StartActivity(i);
                    HDLCommon.Current.AdjustPushMessage(pushMes);
                });
                //Shared.Application.RunOnMainThread(() =>
                //{
                //    if (Shared.Application.Activity == null)
                //    {
                //        var tempIntent = new Intent(context, typeof(Shared.BaseActivity));//Intent intent=new Intent( èµ·å§‹ç»„件对象 , ç›®æ ‡ Service.class);
                //        tempIntent.SetFlags(ActivityFlags.BroughtToFront);
                //        context.StartActivity(tempIntent);
                //        HDLCommon.Current.AdjustPushMessage(pushMes);
                //    }
                //    else
                //    {
                //        (Shared.Application.Activity as BaseActivity).MoveToFront();
                //        HDLCommon.Current.AdjustPushMessage(pushMes);
                //    }
                //});
            }
            catch
            {
            }
            //catch (Exception ex)
            //{
            //    Utlis.WriteLine(ex.ToString());
            //}
        }
    }
}
Xamarin.Android¼¯³É²Î¿¼/JPush/JPushService.cs
New file
@@ -0,0 +1,11 @@

using CN.Jpush.Android.Service;
namespace HDL_ON_Android
{
    [Android.App.Service(Enabled =true,Exported =false,Process = ":pushcore")]
    [Android.App.IntentFilter(new string[] { "cn.jiguang.user.service.action" })]
    public class JPushService: JCommonService
    {
    }
}