1

(PhoneGapビルドを使用して)Androidアプリでローカル通知をスケジュールする際に問題が発生しています。Android - PhoneGapビルド/ Apache Cordova 4.1.1のローカル通知をスケジュールする。

設定された日時にローカル通知をスケジュールしようとしています(たとえば、2016年9月23日午後12時)。

私は、次のプラグインを使用してみました

https://build.phonegap.com/plugins/2081

マイconfig.xmlファイルは次のようになります。

:私はその後、以下のコードを使用して通知をスケジュール

<?xml version="1.0" encoding="UTF-8" ?> 
<widget xmlns = "http://www.w3.org/ns/widgets" 
    xmlns:gap = "http://phonegap.com/ns/1.0" 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    id   = "****" 
    versionCode = "292000" 
    version  = "2.9.2" > 

    <gap:config-file platform="android" parent="/manifest"> 
<application android:debuggable="true" /> 
</gap:config-file> 

<!-- versionCode is optional and Android only --> 

<name>****</name> 

<description> 
    **** 
</description> 

<author href="****" email="****"> 
    **** 
</author> 

<icon src="icon.png" /> 
<allow-navigation href="*" /> 
<access origin="*" /> 

<preference name="phonegap-version" value="cli-5.2.0" /> 
<preference name="android-minSdkVersion" value="14" /> 
<preference name="android-targetSdkVersion" value="23"/> 

<gap:plugin name='cordova-plugin-whitelist' source='npm' /> 

<plugin name="de.appplant.cordova.plugin.local-notification" spec="0.8.1" source="pgb" /> 

</widget> 

cordova.plugins.notification.local.schedule({ 
    title: $title, 
    text: $message, 
    at: $date 
}); 

最新のPhoneGapバージョン(cli-6。 3.0)、私はbuild.phonegap.comサイトで次のエラーを取得する:

Error - Some official plugins have to be updated if using PhoneGap >= 4.0.0. Please upgrade the version of any plugins that may include the following file: LocalNotification.java

プラグインはビルドが失敗する原因のPhoneGapの最新バージョンに更新されていないようです。

私はプラグインの最新のサポートされているバージョン(PhoneGap 3.7.0)用のビルドを試しました。ビルドが正常に完了し、Androidデバイスに直接インストールすると、すべて正常に動作します。通知は予定どおりに発生します。

Google Playストアにこのビルドを提出しようとしたときただし、ビルドは次のエラーで拒否されています

Your APK has been rejected for containing security vulnerabilities, which violates the Malicious Behavior policy. The Alerts page has more information about how to resolve the issue. If you submitted an update, the previous version of your app is still live on Google Play.

ビルドは今に受け入れられるためにはApache CordovaののV4.1.1を使用する必要がありますGoogle Play。

私は見回しましたが、解決策はどこにも見つかりませんでした。誰かが修正プログラムを知っているのですか、またはApache Cordova v4.1.1以上をサポートするAndroid上でローカル通知のスケジュールを可能にする別のプラグインですか?

<plugin name='cordova-plugin-whitelist' source='npm' /> 

<plugin name="de.appplant.cordova.plugin.local-notification" spec="0.8.4" source="npm" /> 
+0

<plugin name="de.appplant.cordova.plugin.local-notification" spec="0.8.4" source="pgb" /> 

を変更しました - https://github.com/gandhirajan/ Cordova_Local_Notificationあなたが始めるのを助けるはずです。 – Gandhi

+0

基本的なローカル通知の作業サンプルを以下のリンクからチェックしてください - github.com/gandhirajan/Cordova_Local_Notification – Gandhi

答えて

1

変更

<gap:plugin name='cordova-plugin-whitelist' source='npm' /> 

<plugin name="de.appplant.cordova.plugin.local-notification" spec="0.8.1" source="pgb" /> 

私は自分自身を修正しました。

プラグイン名を変更すると機能します。

適切なプラグインを見つけて、config.xmlの古いバージョンを置き換える必要があります。

私の場合、私は次のリンクでの基本的なローカル通知ワーキングサンプルをチェック@RaGu

<gap:plugin name="trunk.plugin.local-notification" /> 
関連する問題