share_apps 0.1.3 copy "share_apps: ^0.1.3" to clipboard
share_apps: ^0.1.3 copied to clipboard

outdated

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.1.3

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 #

There are two methods for send invitation #

1.sendInvitation() (This method will use when need to ask details from user) #

2.sendInvitationInBackground() (This method will use when you have user details and pass it in background without user interface.) #

For more details please take look example. #

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);
          },
        ),
      ),
    );
  }
}

sendInvitationInBackground() #

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 in Background'),
          onPressed: () {
            ShareApps.sendInvitationInBackground(
                            context: context,
                            firstName: 'ABC',
                            lastName: 'XYZ',
                            countryName: 'United States',
                            email: 'xyz@gmail.com',
                            language: 'ENGLISH',
                            number: '444123456'
                          );
          },
        ),
      ),
    );
  }
}

Example Demo #

https://github.com/Prashant09mca/flutter-share-apps-SDK-example

Country List #

View Country List

5
likes
0
pub points
59%
popularity

Publisher

verified publishershareapps.net

Put your app in front of everyone through their peers. Peer-to-peer invitations in a very subtle and simple way.

Homepage

License

unknown (license)

Dependencies

contacts_service, device_id, flutter, fluttertoast, http, loading_indicator, permission_handler, shared_preferences, url_launcher

More

Packages that depend on share_apps