share_apps 0.0.12 share_apps: ^0.0.12 copied to clipboard
Put your app in front of everyone through their peers. Peer-to-peer invitations in a very subtle and simple way.
share_apps #
Put your app in front of everyone through their peers. Peer-to-peer invitations in a very subtle and simple way.
Getting Started #
This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.
For help getting started with Share app, view our online documentation, which offers tutorials, samples, guidance on SDK integration, and a full API reference.
Installation #
dependencies:
...
share_apps: ^0.0.12
Permissions #
Android #
Add the following permissions to your AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />
iOS #
Set the NSContactsUsageDescription
in your Info.plist
file
<key>NSContactsUsageDescription</key>
<string>This app requires contacts access to function properly.</string>
How to use. #
import share_apps.dar
import 'package:share_apps/share_apps.dart';
Example #
STEP: 1 #
Initialize ShareApps with your secretKey and appId in main.dart file.
import 'package:flutter/material.dart';
import 'package:share_apps/share_apps.dart';
void main() {
ShareApps.init(appId: 'XXXXXXXXXX', secreteKey: 'XXXXXXXXXXXX');
runApp(MyApp());
}
STEP: 2 #
Create click and call sendInvitation().
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Share App Demo'),
),
body: Center(
child: RaisedButton(
child: Text('Invite Friends'),
onPressed: () {
ShareApps.sendInvitation(context: context);
},
),
),
);
}
}