Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancements and Bug Fixes for Improved Compatibility and Functionality #35

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
15 changes: 7 additions & 8 deletions example/push_notifications/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import 'dart:io' show Platform;
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:talkjs_flutter/talkjs_flutter.dart';
import 'package:firebase_core/firebase_core.dart';

import 'firebase_options.dart';

Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();

if (Platform.isAndroid) {
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
}
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);

await Talk.registerPushNotificationHandlers(
androidChannel: const AndroidChannel(
Expand All @@ -34,7 +32,8 @@ class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
final session = Session(appId: 'YOUR_APP_ID', enablePushNotifications: true);
final session =
Session(appId: 'YOUR_APP_ID', enablePushNotifications: true);

final me = session.getUser(
id: '123456',
Expand Down
Loading