Skip to content

Commit

Permalink
flutter-posthog => posthog-flutter
Browse files Browse the repository at this point in the history
  • Loading branch information
fuziontech committed Jun 25, 2020
1 parent 8883c70 commit d4a5c40
Show file tree
Hide file tree
Showing 27 changed files with 83 additions and 83 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Posthog plugin

![Pub Version](https://img.shields.io/pub/v/flutter_posthog)
![Pub Version](https://img.shields.io/pub/v/posthog_flutter)

Flutter plugin to support iOS, Android and Web sources at https://posthog.com.

## Usage

To use this plugin, add `flutter_posthog` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).
To use this plugin, add `posthog_flutter` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/).

### Supported methods

Expand All @@ -29,7 +29,7 @@ To use this plugin, add `flutter_posthog` as a [dependency in your pubspec.yaml

```dart
import 'package:flutter/material.dart';
import 'package:flutter_posthog/flutter_posthog.dart';
import 'package:posthog_flutter/posthog_flutter.dart';
void main() => runApp(MyApp());
Expand Down Expand Up @@ -80,7 +80,7 @@ Remember that the application lifecycle events won't have any special context se
#### AndroidManifest.xml

```xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.posthog.flutter_posthog_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.posthog.posthog_flutter_example">
<application>
<activity>
[...]
Expand Down Expand Up @@ -139,8 +139,8 @@ For more informations please check: https://posthog.com/docs/integrations/js-int

## Issues

Please file any issues, bugs, or feature requests in the [GitHub repo](https://github.com/posthog/flutter-posthog/issues/new).
Please file any issues, bugs, or feature requests in the [GitHub repo](https://github.com/posthog/posthog-flutter/issues/new).

## Contributing

If you wish to contribute a change to this repo, please send a [pull request](https://github.com/posthog/flutter-posthog/pulls).
If you wish to contribute a change to this repo, please send a [pull request](https://github.com/posthog/posthog-flutter/pulls).
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group 'com.posthog.flutter_posthog'
group 'com.posthog.posthog_flutter'
version '1.0-SNAPSHOT'

buildscript {
Expand Down
2 changes: 1 addition & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'flutter_posthog'
rootProject.name = 'posthog_flutter'
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.posthog.flutter_posthog">
package="com.posthog.posthog_flutter">
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.posthog.flutter_posthog;
package com.posthog.posthog_flutter;

import android.app.Activity;
import android.content.Context;
Expand Down Expand Up @@ -29,16 +29,16 @@
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.embedding.engine.plugins.FlutterPlugin;

/** FlutterPosthogPlugin */
public class FlutterPosthogPlugin implements MethodCallHandler, FlutterPlugin {
/** PosthogFlutterPlugin */
public class PosthogFlutterPlugin implements MethodCallHandler, FlutterPlugin {
private Context applicationContext;
private MethodChannel methodChannel;

static HashMap<String, Object> appendToContextMiddleware;

/** Plugin registration. */
public static void registerWith(PluginRegistry.Registrar registrar) {
final FlutterPosthogPlugin instance = new FlutterPosthogPlugin();
final PosthogFlutterPlugin instance = new PosthogFlutterPlugin();
instance.setupChannels(registrar.context(), registrar.messenger());
}

Expand All @@ -49,7 +49,7 @@ public void onAttachedToEngine(FlutterPluginBinding binding) {

private void setupChannels(Context applicationContext, BinaryMessenger messenger) {
try {
methodChannel = new MethodChannel(messenger, "flutter_posthog");
methodChannel = new MethodChannel(messenger, "posthog_flutter");
this.applicationContext = applicationContext;

ApplicationInfo ai = applicationContext.getPackageManager()
Expand Down Expand Up @@ -91,7 +91,7 @@ public void intercept(Chain chain) {

chain.proceed(newPayload);
} catch (Exception e) {
Log.e("FlutterPosthog", e.getMessage());
Log.e("PosthogFlutter", e.getMessage());
chain.proceed(chain.payload());
}
}
Expand All @@ -105,12 +105,12 @@ public void intercept(Chain chain) {
try {
PostHog.setSingletonInstance(analyticsBuilder.build());
} catch (IllegalStateException e) {
Log.w("FlutterPosthog", e.getMessage());
Log.w("PosthogFlutter", e.getMessage());
}
// register the channel to receive calls
methodChannel.setMethodCallHandler(this);
} catch (Exception e) {
Log.e("FlutterPosthog", e.getMessage());
Log.e("PosthogFlutter", e.getMessage());
}
}

Expand Down Expand Up @@ -150,7 +150,7 @@ private void identify(MethodCall call, Result result) {
this.callIdentify(userId, traitsData, options);
result.success(true);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand Down Expand Up @@ -179,7 +179,7 @@ private void track(MethodCall call, Result result) {
this.callTrack(eventName, propertiesData, options);
result.success(true);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand Down Expand Up @@ -208,7 +208,7 @@ private void screen(MethodCall call, Result result) {
this.callScreen(screenName, propertiesData, options);
result.success(true);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand Down Expand Up @@ -237,7 +237,7 @@ private void alias(MethodCall call, Result result) {
PostHog.with(this.applicationContext).alias(alias, options);
result.success(true);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand All @@ -246,7 +246,7 @@ private void anonymousId(Result result) {
String anonymousId = PostHog.with(this.applicationContext).getAnonymousId();
result.success(anonymousId);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand All @@ -255,7 +255,7 @@ private void reset(Result result) {
PostHog.with(this.applicationContext).reset();
result.success(true);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand All @@ -264,7 +264,7 @@ private void setContext(MethodCall call, Result result) {
this.appendToContextMiddleware = call.argument("context");
result.success(true);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand All @@ -275,7 +275,7 @@ private void enable(MethodCall call, Result result) {
PostHog.with(this.applicationContext).optOut(false);
result.success(true);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand All @@ -286,7 +286,7 @@ private void disable(MethodCall call, Result result) {
PostHog.with(this.applicationContext).optOut(true);
result.success(true);
} catch (Exception e) {
result.error("FlutterPosthogException", e.getLocalizedMessage(), null);
result.error("PosthogFlutterException", e.getLocalizedMessage(), null);
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# flutter_posthog_example
# posthog_flutter_example

Demonstrates how to use the flutter_posthog plugin.
Demonstrates how to use the posthog_flutter plugin.

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.posthog.flutter_posthog_example"
applicationId "com.posthog.posthog_flutter_example"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/src/main/AndroidManifest.xml
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="com.posthog.flutter_posthog_example">
package="com.posthog.posthog_flutter_example">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand All @@ -8,7 +8,7 @@
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutter_posthog_example"
android:label="posthog_flutter_example"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.posthog.flutter_posthog_example;
package com.posthog.posthog_flutter_example;


import io.flutter.embedding.android.FlutterActivity;
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/src/profile/AndroidManifest.xml
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="com.posthog.flutter_posthog_example">
package="com.posthog.posthog_flutter_example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
Expand Down
10 changes: 5 additions & 5 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PODS:
- Branch/Core (= 0.33.1)
- Branch/Core (0.33.1)
- Flutter (1.0.0)
- flutter_posthog (0.0.1):
- posthog_flutter (0.0.1):
- Analytics (= 4.0.1)
- Flutter
- Posthog-Branch
Expand All @@ -14,7 +14,7 @@ PODS:

DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_posthog (from `.symlinks/plugins/flutter_posthog/ios`)
- posthog_flutter (from `.symlinks/plugins/posthog_flutter/ios`)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
Expand All @@ -25,14 +25,14 @@ SPEC REPOS:
EXTERNAL SOURCES:
Flutter:
:path: Flutter
flutter_posthog:
:path: ".symlinks/plugins/flutter_posthog/ios"
posthog_flutter:
:path: ".symlinks/plugins/posthog_flutter/ios"

SPEC CHECKSUMS:
Analytics: ebdc0c3ed93684d10c898f57886e0ce7fbecc240
Branch: 65d05ffb137ef504777cff6bd4fb6f770f17145a
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
flutter_posthog: 0357d36d6b066d5d255cda46d2f217b55110af95
posthog_flutter: 0357d36d6b066d5d255cda46d2f217b55110af95
Posthog-Branch: f255ba1354f6aa1bc8654d450b3b933380f2558d

PODFILE CHECKSUM: 3dbe063e9c90a5d7c9e4e76e70a821b9e2c1d271
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.posthog.flutterPosthogExample;
PRODUCT_BUNDLE_IDENTIFIER = com.posthog.PosthogFlutterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down Expand Up @@ -519,7 +519,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterPosthogExample;
PRODUCT_BUNDLE_IDENTIFIER = com.example.PosthogFlutterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
Expand All @@ -543,7 +543,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterPosthogExample;
PRODUCT_BUNDLE_IDENTIFIER = com.example.PosthogFlutterExample;
PRODUCT_NAME = "$(TARGET_NAME)";
VERSIONING_SYSTEM = "apple-generic";
};
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>flutter_posthog_example</string>
<string>posthog_flutter_example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_posthog/flutter_posthog.dart';
import 'package:posthog_flutter/posthog_flutter.dart';

void main() {
/// Wait until the platform channel is properly initialized so we can call
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: flutter_posthog_example
description: Demonstrates how to use the flutter_posthog plugin.
name: posthog_flutter_example
description: Demonstrates how to use the posthog_flutter plugin.
publish_to: "none"

version: 0.0.1+1
Expand All @@ -10,7 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_posthog:
posthog_flutter:
path: ../

# The following adds the Cupertino Icons font to your application.
Expand Down
2 changes: 1 addition & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import 'package:flutter_posthog_example/main.dart';
import 'package:posthog_flutter_example/main.dart';

void main() {
testWidgets('Verify Platform version', (WidgetTester tester) async {
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/FlutterPosthogPlugin.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import <Flutter/Flutter.h>

@interface FlutterPosthogPlugin : NSObject <FlutterPlugin>
@interface PosthogFlutterPlugin : NSObject <FlutterPlugin>
@end
Loading

0 comments on commit d4a5c40

Please sign in to comment.