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/connectivity_plus/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.6.0

- Fix issue #56: Rename Android and iOS classes and Method Channel to avoid
collision with the original connectivity package.

## 0.5.0

- Transfer to plus-plugins monorepo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.plugins.connectivity">
package="dev.fluttercommunity.plus.connectivity">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
</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.connectivity;
package dev.fluttercommunity.plus.connectivity;

import android.net.ConnectivityManager;
import android.net.Network;
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.connectivity;
package dev.fluttercommunity.plus.connectivity;

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.connectivity;
package dev.fluttercommunity.plus.connectivity;

import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
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.connectivity;
package dev.fluttercommunity.plus.connectivity;

import android.content.Context;
import android.net.ConnectivityManager;
Expand Down Expand Up @@ -37,8 +37,8 @@ public void onDetachedFromEngine(FlutterPluginBinding binding) {
}

private void setupChannels(BinaryMessenger messenger, Context context) {
methodChannel = new MethodChannel(messenger, "plugins.flutter.io/connectivity");
eventChannel = new EventChannel(messenger, "plugins.flutter.io/connectivity_status");
methodChannel = new MethodChannel(messenger, "dev.fluttercommunity.plus/connectivity");
eventChannel = new EventChannel(messenger, "dev.fluttercommunity.plus/connectivity_status");
ConnectivityManager connectivityManager =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
package io.flutter.plugins.connectivityexample;

import android.os.Bundle;
import dev.fluttercommunity.plus.connectivity.ConnectivityPlugin;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.connectivity.ConnectivityPlugin;

public class EmbeddingV1Activity extends FlutterActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ConnectivityPlugin.registerWith(
registrarFor("io.flutter.plugins.connectivity.ConnectivityPlugin"));
registrarFor("dev.fluttercommunity.plus.connectivity.ConnectivityPlugin"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d206f67b31bd605ac9da4b25c076af42
18 changes: 18 additions & 0 deletions packages/connectivity_plus/example/ios/Flutter/Flutter.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# NOTE: This podspec is NOT to be published. It is only used as a local source!
#

Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.description = <<-DESC
Flutter provides an easy and productive way to build and deploy high-performance mobile apps for Android and iOS.
DESC
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.vendored_frameworks = 'Flutter.framework'
end
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
/* Begin PBXBuildFile section */
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
Expand All @@ -28,8 +24,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -41,14 +35,12 @@
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3173C764DD180BE02EB51E47 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
69D903F0A9A7C636EE803AF8 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
Expand All @@ -63,8 +55,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
EB0BA966000B5C35B13186D7 /* libPods-Runner.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -92,9 +82,7 @@
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B80C3931E831B6300D905FE /* App.framework */,
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEBA1CF902C7004384FC /* Flutter.framework */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
Expand Down Expand Up @@ -229,7 +217,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin";
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
3BAF367E8BACBC7576CEE653 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand All @@ -255,9 +243,12 @@
files = (
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
"${PODS_ROOT}/../Flutter/Flutter.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -315,7 +306,6 @@
/* Begin XCBuildConfiguration section */
97C147031CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down Expand Up @@ -372,7 +362,6 @@
};
97C147041CF9000F007C117D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

NS_ASSUME_NONNULL_BEGIN

@class FLTConnectivityLocationDelegate;
@class FLTConnectivityLocationPlusDelegate;

typedef void (^FLTConnectivityLocationCompletion)(CLAuthorizationStatus);
typedef void (^FLTConnectivityLocationPlusCompletion)(CLAuthorizationStatus);

@interface FLTConnectivityLocationHandler : NSObject
@interface FLTConnectivityLocationPlusHandler : NSObject

+ (CLAuthorizationStatus)locationAuthorizationStatus;

- (void)requestLocationAuthorization:(BOOL)always
completion:(_Nonnull FLTConnectivityLocationCompletion)completionHnadler;
completion:(_Nonnull FLTConnectivityLocationPlusCompletion)completionHnadler;

@end

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

#import "FLTConnectivityLocationHandler.h"
#import "FLTConnectivityLocationPlusHandler.h"

@interface FLTConnectivityLocationHandler () <CLLocationManagerDelegate>
@interface FLTConnectivityLocationPlusHandler () <CLLocationManagerDelegate>

@property(copy, nonatomic) FLTConnectivityLocationCompletion completion;
@property(copy, nonatomic) FLTConnectivityLocationPlusCompletion completion;
@property(strong, nonatomic) CLLocationManager *locationManager;

@end

@implementation FLTConnectivityLocationHandler
@implementation FLTConnectivityLocationPlusHandler

+ (CLAuthorizationStatus)locationAuthorizationStatus {
return CLLocationManager.authorizationStatus;
}

- (void)requestLocationAuthorization:(BOOL)always
completion:(FLTConnectivityLocationCompletion)completionHandler {
completion:(FLTConnectivityLocationPlusCompletion)completionHandler {
CLAuthorizationStatus status = CLLocationManager.authorizationStatus;
if (status != kCLAuthorizationStatusAuthorizedWhenInUse && always) {
completionHandler(kCLAuthorizationStatusDenied);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

#import <Flutter/Flutter.h>

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

#import "FLTConnectivityPlugin.h"
#import "FLTConnectivityPlusPlugin.h"

#import "Reachability/Reachability.h"

#import <CoreLocation/CoreLocation.h>
#import "FLTConnectivityLocationHandler.h"
#import "FLTConnectivityLocationPlusHandler.h"
#import "SystemConfiguration/CaptiveNetwork.h"

#include <ifaddrs.h>

#include <arpa/inet.h>

@interface FLTConnectivityPlugin () <FlutterStreamHandler, CLLocationManagerDelegate>
@interface FLTConnectivityPlusPlugin () <FlutterStreamHandler, CLLocationManagerDelegate>

@property(strong, nonatomic) FLTConnectivityLocationHandler* locationHandler;
@property(strong, nonatomic) FLTConnectivityLocationPlusHandler* locationHandler;

@end

@implementation FLTConnectivityPlugin {
@implementation FLTConnectivityPlusPlugin {
FlutterEventSink _eventSink;
Reachability* _reachabilityForInternetConnection;
}

+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
FLTConnectivityPlugin* instance = [[FLTConnectivityPlugin alloc] init];
FLTConnectivityPlusPlugin* instance = [[FLTConnectivityPlusPlugin alloc] init];

FlutterMethodChannel* channel =
[FlutterMethodChannel methodChannelWithName:@"plugins.flutter.io/connectivity"
[FlutterMethodChannel methodChannelWithName:@"dev.fluttercommunity.plus/connectivity"
binaryMessenger:[registrar messenger]];
[registrar addMethodCallDelegate:instance channel:channel];

FlutterEventChannel* streamChannel =
[FlutterEventChannel eventChannelWithName:@"plugins.flutter.io/connectivity_status"
[FlutterEventChannel eventChannelWithName:@"dev.fluttercommunity.plus/connectivity_status"
binaryMessenger:[registrar messenger]];
[streamChannel setStreamHandler:instance];
}
Expand Down Expand Up @@ -118,7 +118,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
} else if ([call.method isEqualToString:@"wifiIPAddress"]) {
result([self getWifiIP]);
} else if ([call.method isEqualToString:@"getLocationServiceAuthorization"]) {
result([self convertCLAuthorizationStatusToString:[FLTConnectivityLocationHandler
result([self convertCLAuthorizationStatusToString:[FLTConnectivityLocationPlusHandler
locationAuthorizationStatus]]);
} else if ([call.method isEqualToString:@"requestLocationServiceAuthorization"]) {
NSArray* arguments = call.arguments;
Expand Down Expand Up @@ -162,9 +162,9 @@ - (NSString*)convertCLAuthorizationStatusToString:(CLAuthorizationStatus)status
}
}

- (FLTConnectivityLocationHandler*)locationHandler {
- (FLTConnectivityLocationPlusHandler*)locationHandler {
if (!_locationHandler) {
_locationHandler = [FLTConnectivityLocationHandler new];
_locationHandler = [FLTConnectivityLocationPlusHandler new];
}
return _locationHandler;
}
Expand Down
12 changes: 6 additions & 6 deletions packages/connectivity_plus/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: connectivity_plus
description: Flutter plugin for discovering the state of the network (WiFi & mobile/cellular) connectivity on Android and iOS.
version: 0.5.0
version: 0.6.0
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/

flutter:
plugin:
platforms:
android:
package: io.flutter.plugins.connectivity
package: dev.fluttercommunity.plus.connectivity
pluginClass: ConnectivityPlugin
ios:
pluginClass: FLTConnectivityPlugin
pluginClass: FLTConnectivityPlusPlugin
macos:
default_package: connectivity_plus_macos
web:
Expand All @@ -21,9 +21,9 @@ dependencies:
flutter:
sdk: flutter
meta: ^1.0.5
connectivity_plus_platform_interface: ^0.2.0
connectivity_plus_macos: ^0.2.0
connectivity_plus_web: ^0.4.0
connectivity_plus_platform_interface: ^0.3.0
connectivity_plus_macos: ^0.3.0
connectivity_plus_web: ^0.5.0

dev_dependencies:
flutter_test:
Expand Down
4 changes: 4 additions & 0 deletions packages/connectivity_plus_macos/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.0

- Updated platform interface

## 0.2.0

- Transfer to plus-plugins monorepo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ public class ConnectivityPlugin: NSObject, FlutterPlugin, FlutterStreamHandler {

public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(
name: "plugins.flutter.io/connectivity",
name: "dev.fluttercommunity.plus/connectivity",
binaryMessenger: registrar.messenger)

let streamChannel = FlutterEventChannel(
name: "plugins.flutter.io/connectivity_status",
name: "dev.fluttercommunity.plus/connectivity_status",
binaryMessenger: registrar.messenger)

let instance = ConnectivityPlugin()
Expand Down
4 changes: 2 additions & 2 deletions packages/connectivity_plus_macos/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: connectivity_plus_macos
description: macOS implementation of the connectivity_plus plugin.
version: 0.2.0
version: 0.3.0
homepage: https://plus.fluttercommunity.dev/
repository: https://github.com/fluttercommunity/plus_plugins/tree/main/packages/

Expand All @@ -15,7 +15,7 @@ environment:
flutter: '>=1.20.0'

dependencies:
connectivity_plus_platform_interface: ^0.2.0
connectivity_plus_platform_interface: ^0.3.0
flutter:
sdk: flutter

Expand Down
Loading