Skip to content

Commit 7c2d4fa

Browse files
committed
recreate android example
1 parent beba636 commit 7c2d4fa

File tree

22 files changed

+275
-214
lines changed

22 files changed

+275
-214
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: CI
22
on:
33
pull_request:
44
branches:
5-
- '**'
5+
- "**"
66
paths-ignore:
7-
- '.github/**'
8-
- '.vscode/**'
9-
- 'README.md'
7+
- ".github/**"
8+
- ".vscode/**"
9+
- "README.md"
1010
workflow_dispatch:
1111

1212
jobs:
@@ -17,8 +17,8 @@ jobs:
1717
- name: Setup Flutter
1818
uses: subosito/flutter-action@v2
1919
with:
20-
flutter-version: '3.3.2'
21-
channel: 'stable'
20+
flutter-version: "3.35.0"
21+
channel: "stable"
2222

2323
- name: Checkout OneSignal-Flutter-SDK
2424
uses: actions/checkout@v3

example/.metadata

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,27 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: c7ea3ca377e909469c68f2ab878a5bc53d3cf66b
8-
channel: beta
7+
revision: "d693b4b9dbac2acd4477aea4555ca6dcbea44ba2"
8+
channel: "stable"
9+
10+
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
17+
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
18+
- platform: android
19+
create_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
20+
base_revision: d693b4b9dbac2acd4477aea4555ca6dcbea44ba2
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/analysis_options.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

example/android/.gitignore

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
*.iml
2-
*.class
3-
.gradle
1+
gradle-wrapper.jar
2+
/.gradle
3+
/captures/
4+
/gradlew
5+
/gradlew.bat
46
/local.properties
5-
/.idea/workspace.xml
6-
/.idea/libraries
7-
.DS_Store
8-
/build
9-
/captures
107
GeneratedPluginRegistrant.java
8+
.cxx/
9+
10+
# Remember to never publicly share your keystore.
11+
# See https://flutter.dev/to/reference-keystore
12+
key.properties
13+
**/*.keystore
14+
**/*.jks

example/android/app/build.gradle

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id("dev.flutter.flutter-gradle-plugin")
6+
}
7+
8+
android {
9+
namespace = "com.onesignal.onesignal_example"
10+
compileSdk = flutter.compileSdkVersion
11+
ndkVersion = flutter.ndkVersion
12+
13+
compileOptions {
14+
sourceCompatibility = JavaVersion.VERSION_11
15+
targetCompatibility = JavaVersion.VERSION_11
16+
}
17+
18+
kotlinOptions {
19+
jvmTarget = JavaVersion.VERSION_11.toString()
20+
}
21+
22+
defaultConfig {
23+
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24+
applicationId = "com.onesignal.onesignal_example"
25+
// You can update the following values to match your application needs.
26+
// For more information, see: https://flutter.dev/to/review-gradle-config.
27+
minSdk = flutter.minSdkVersion
28+
targetSdk = flutter.targetSdkVersion
29+
versionCode = flutter.versionCode
30+
versionName = flutter.versionName
31+
}
32+
33+
buildTypes {
34+
release {
35+
// TODO: Add your own signing config for the release build.
36+
// Signing with the debug keys for now, so `flutter run --release` works.
37+
signingConfig = signingConfigs.getByName("debug")
38+
}
39+
}
40+
}
41+
42+
flutter {
43+
source = "../.."
44+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
2+
<!-- The INTERNET permission is required for development. Specifically,
3+
the Flutter tool needs it to communicate with the running application
4+
to allow setting breakpoints, to provide hot reload, etc.
5+
-->
6+
<uses-permission android:name="android.permission.INTERNET"/>
7+
</manifest>
Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,25 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.onesignal.onesignalexample">
3-
4-
<!-- The INTERNET permission is required for development. Specifically,
5-
flutter needs it to communicate with the running application
6-
to allow setting breakpoints, to provide hot reload, etc.
7-
-->
8-
<uses-permission android:name="android.permission.INTERNET"/>
9-
10-
<uses-permission android:name="com.android.vending.BILLING" />
11-
12-
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
13-
14-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
15-
16-
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
17-
calls FlutterMain.startInitialization(this); in its onCreate method.
18-
In most cases you can leave this as-is, but you if you want to provide
19-
additional functionality it is fine to subclass or reimplement
20-
FlutterApplication and put your custom class here. -->
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
212
<application
223
android:label="onesignal_example"
4+
android:name="${applicationName}"
235
android:icon="@mipmap/ic_launcher">
246
<activity
257
android:name=".MainActivity"
268
android:exported="true"
279
android:launchMode="singleTop"
10+
android:taskAffinity=""
2811
android:theme="@style/LaunchTheme"
29-
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
12+
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
3013
android:hardwareAccelerated="true"
3114
android:windowSoftInputMode="adjustResize">
3215
<!-- Specifies an Android theme to apply to this Activity as soon as
3316
the Android process has started. This theme is visible to the user
3417
while the Flutter UI initializes. After that, this theme continues
3518
to determine the Window background behind the Flutter UI. -->
3619
<meta-data
37-
android:name="io.flutter.embedding.android.NormalTheme"
38-
android:resource="@style/NormalTheme"
39-
/>
40-
<!-- Displays an Android View that continues showing the launch screen
41-
Drawable until Flutter paints its first frame, then this splash
42-
screen fades out. A splash screen is useful to avoid any visual
43-
gap between the end of Android's launch screen and the painting of
44-
Flutter's first frame. -->
45-
<meta-data
46-
android:name="io.flutter.embedding.android.SplashScreenDrawable"
47-
android:resource="@drawable/launch_background"
48-
/>
20+
android:name="io.flutter.embedding.android.NormalTheme"
21+
android:resource="@style/NormalTheme"
22+
/>
4923
<intent-filter>
5024
<action android:name="android.intent.action.MAIN"/>
5125
<category android:name="android.intent.category.LAUNCHER"/>
@@ -57,4 +31,15 @@
5731
android:name="flutterEmbedding"
5832
android:value="2" />
5933
</application>
34+
<!-- Required to query activities that can process text, see:
35+
https://developer.android.com/training/package-visibility and
36+
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
37+
38+
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
39+
<queries>
40+
<intent>
41+
<action android:name="android.intent.action.PROCESS_TEXT"/>
42+
<data android:mimeType="text/plain"/>
43+
</intent>
44+
</queries>
6045
</manifest>

example/android/app/src/main/java/com/onesignal/onesignalexample/MainActivity.java

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.onesignal.onesignal_example
2+
3+
import io.flutter.embedding.android.FlutterActivity
4+
5+
class MainActivity : FlutterActivity()

0 commit comments

Comments
 (0)