share_apps 0.3.2 share_apps: ^0.3.2 copied to clipboard
Put your app in front of everyone through their peers. Peer-to-peer invitations in a very subtle and simple way.
import 'package:flutter/material.dart';
import 'package:share_apps/share_apps.dart';
void main() {
ShareApps.init(
appId: '15539901308027672219',
// (AppId from)royalty.shareapps.net
secreteKey: '5ca001f255007786922623',
// (secreteKey from)royalty.shareapps.net
email: 'prashant09mca@gmail.com',
//(Email Address which registered in )royalty.shareapps.net (It required for email invitation)
app_name: 'Testing_Package',
); //(Enter Your app name in which you integrate ShareApp SDK)
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Share App Demo'),
),
body: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
child: Text('Invite Friends'),
onPressed: () {
ShareApps.sendInvitation(context: context);
},
),
TextButton(
child: Text('Invite Friends Background'),
onPressed: () {
ShareApps.sendInvitationInBackground(
context: context,
firstName: 'Prashant',
//User First Name
lastName: 'Padmani',
//User LastName
email: 'prashant09mca@gmail.com',
//User Email Address
countryCode: 'US',
// User Country
language: 'English',
//User Language
number: '+919825711336',
); //User Mobile Number With Country Code
},
),
],
),
),
);
}
}