Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/android_alarm_manager_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.6.0

- Renamed Method Channel and changed Java package to avoid collision with android_alarm_manager
- Needs update in AndroidManifest.xml of your app.

## 0.5.0

- Transfer to plus-plugins monorepo
Expand Down
6 changes: 3 additions & 3 deletions packages/android_alarm_manager_plus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Next, within the `<application></application>` tags, add:

```xml
<service
android:name="io.flutter.plugins.androidalarmmanager.AlarmService"
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="false"/>
<receiver
android:name="io.flutter.plugins.androidalarmmanager.AlarmBroadcastReceiver"
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmBroadcastReceiver"
android:exported="false"/>
<receiver
android:name="io.flutter.plugins.androidalarmmanager.RebootBroadcastReceiver"
android:name="dev.fluttercommunity.plus.androidalarmmanager.RebootBroadcastReceiver"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"></action>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.plugins.androidalarmmanager">
package="dev.fluttercommunity.plus.androidalarmmanager">
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.androidalarmmanager;
package dev.fluttercommunity.plus.androidalarmmanager;

import android.content.BroadcastReceiver;
import android.content.Context;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.androidalarmmanager;
package dev.fluttercommunity.plus.androidalarmmanager;

import android.app.AlarmManager;
import android.app.PendingIntent;
Expand All @@ -14,21 +14,16 @@
import androidx.core.app.AlarmManagerCompat;
import androidx.core.app.JobIntentService;
import io.flutter.plugin.common.PluginRegistry.PluginRegistrantCallback;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.*;
import java.util.concurrent.CountDownLatch;
import org.json.JSONException;
import org.json.JSONObject;

public class AlarmService extends JobIntentService {
private static final String TAG = "AlarmService";
private static final String PERSISTENT_ALARMS_SET_KEY = "persistent_alarm_ids";
protected static final String SHARED_PREFERENCES_KEY = "io.flutter.android_alarm_manager_plugin";
protected static final String SHARED_PREFERENCES_KEY =
"dev.fluttercommunity.plus.android_alarm_manager_plugin";
private static final int JOB_ID = 1984; // Random job ID.
private static final Object persistentAlarmsLock = new Object();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.androidalarmmanager;
package dev.fluttercommunity.plus.androidalarmmanager;

import android.content.Context;
import android.util.Log;
Expand Down Expand Up @@ -83,7 +83,9 @@ public void onAttachedToEngine(Context applicationContext, BinaryMessenger messe
// - "Alarm.cancel"
alarmManagerPluginChannel =
new MethodChannel(
messenger, "plugins.flutter.io/android_alarm_manager", JSONMethodCodec.INSTANCE);
messenger,
"dev.fluttercommunity.plus/android_alarm_manager",
JSONMethodCodec.INSTANCE);

// Instantiate a new AndroidAlarmManagerPlugin and connect the primary method channel for
// Android/Flutter communication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.androidalarmmanager;
package dev.fluttercommunity.plus.androidalarmmanager;

import android.content.Context;
import android.content.Intent;
Expand Down Expand Up @@ -234,7 +234,7 @@ private void initializeMethodChannel(BinaryMessenger isolate) {
backgroundChannel =
new MethodChannel(
isolate,
"plugins.flutter.io/android_alarm_manager_background",
"dev.fluttercommunity.plus/android_alarm_manager_background",
JSONMethodCodec.INSTANCE);
backgroundChannel.setMethodCallHandler(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.androidalarmmanager;
package dev.fluttercommunity.plus.androidalarmmanager;

class PluginRegistrantException extends RuntimeException {
public PluginRegistrantException() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.androidalarmmanager;
package dev.fluttercommunity.plus.androidalarmmanager;

import android.content.BroadcastReceiver;
import android.content.ComponentName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@

<!-- Start Alarm Manager -->
<service
android:name="io.flutter.plugins.androidalarmmanager.AlarmService"
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<receiver
android:name="io.flutter.plugins.androidalarmmanager.AlarmBroadcastReceiver"
android:name="dev.fluttercommunity.plus.androidalarmmanager.AlarmBroadcastReceiver"
android:exported="false" />
<receiver
android:name="io.flutter.plugins.androidalarmmanager.RebootBroadcastReceiver"
android:name="dev.fluttercommunity.plus.androidalarmmanager.RebootBroadcastReceiver"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

#import <Flutter/Flutter.h>

@interface FLTAndroidAlarmManagerPlugin : NSObject <FlutterPlugin>
@interface FLTAndroidAlarmManagerPlusPlugin : NSObject <FlutterPlugin>
@end
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#import "AndroidAlarmManagerPlugin.h"
#import "AndroidAlarmManagerPlusPlugin.h"

@implementation FLTAndroidAlarmManagerPlugin
@implementation FLTAndroidAlarmManagerPlusPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FlutterMethodChannel* channel =
[FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/android_alarm_manager"
[FlutterMethodChannel methodChannelWithName:@"dev.fluttercommunity.plus/android_alarm_manager"
binaryMessenger:[registrar messenger]
codec:[FlutterJSONMethodCodec sharedInstance]];
FLTAndroidAlarmManagerPlugin* instance = [[FLTAndroidAlarmManagerPlugin alloc] init];
FLTAndroidAlarmManagerPlusPlugin* instance = [[FLTAndroidAlarmManagerPlusPlugin alloc] init];
[registrar addMethodCallDelegate:instance channel:channel];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'android_alarm_manager'
s.name = 'android_alarm_manager_plus'
s.version = '0.0.1'
s.summary = 'Flutter Android Alarm Manager'
s.description = <<-DESC
A Flutter plugin for accessing the Android AlarmManager service, and running Dart code in the background when alarms fire.
This plugin a no-op on iOS.
This plugin a no-op on iOS.
Downloaded by pub (not CocoaPods).
DESC
s.homepage = 'https://github.com/flutter/plugins'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

const String _backgroundName =
'plugins.flutter.io/android_alarm_manager_background';
'dev.fluttercommunity.plus/android_alarm_manager_background';

// This is the entrypoint for the background isolate. Since we can only enter
// an isolate once, we setup a MethodChannel to listen for method invocations
Expand Down Expand Up @@ -62,7 +62,8 @@ typedef _GetCallbackHandle = CallbackHandle Function(Function callback);
///
/// See the example/ directory in this package for sample usage.
class AndroidAlarmManager {
static const String _channelName = 'plugins.flutter.io/android_alarm_manager';
static const String _channelName =
'dev.fluttercommunity.plus/android_alarm_manager';
static final MethodChannel _channel =
const MethodChannel(_channelName, JSONMethodCodec());

Expand Down
4 changes: 2 additions & 2 deletions packages/android_alarm_manager_plus/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: android_alarm_manager_plus
description: Flutter plugin for accessing the Android AlarmManager service, and
running Dart code in the background when alarms fire.
version: 0.5.0
version: 0.6.0
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/

Expand All @@ -18,7 +18,7 @@ flutter:
plugin:
platforms:
android:
package: io.flutter.plugins.androidalarmmanager
package: dev.fluttercommunity.plus.androidalarmmanager
pluginClass: AndroidAlarmManagerPlugin

environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
void validCallback(int id) => null;

const testChannel = MethodChannel(
'plugins.flutter.io/android_alarm_manager', JSONMethodCodec());
'dev.fluttercommunity.plus/android_alarm_manager', JSONMethodCodec());
TestWidgetsFlutterBinding.ensureInitialized();

setUpAll(() {
Expand Down