Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

getsocial-react-native-sdk

getsocial-im172SEE LICENSE IN LICENSE.txt7.12.6

React Native wrapper for GetSocial iOS and Android SDK

react-native, getsocial, social, feed, topic, group, chat, referral, invite, friends

readme

GetSocial React Native SDK

Learn more about the products we build at getsocial.im.

Getting started

Prerequisities

To start using GetSocial, you have to create a free account and login to GetSocial Dashboard. Dashboard provides a web interface to manage all GetSocial services.

Install React Native package

  1. Run npm install getsocial-react-native-sdk --save in your app's root folder.

Configure GetSocial SDK

Android

To start using GetSocial, you have to add and configure GetSocial Gradle Plugin to your Android project. Plugin adds all GetSocial dependencies to the project and configures AndroidManifest.xml.

To add GetSocial Gradle plugin:

  1. Add repository and classpath dependency for the plugin in your top-level build.gradle. This file is for the entire project so it will be used for global project configurations:

    `groovy hl_lines="5 10" buildscript {

     repositories {
         ...
         maven {
             url "https://plugins.gradle.org/m2/"
         }
     }
     dependencies {
         ...
         classpath "im.getsocial:plugin-v7:[1,2)"
     }

    } `

  2. In the Android application project build.gradle (this file is the module build file, so it will be used for specific module level configs) apply im.getsocial plugin after com.android.application plugin:

    groovy hl_lines="2 5" apply plugin: 'com.android.application' apply plugin: 'im.getsocial' // should be applied after com.android.application plugin

  3. In the same build.gradle configure GetSocial plugin with GetSocial App id:

     getsocial {
         appId "put-your-getsocial-app-id-here"
         ...
     }

Check the GetSocial Gradle plugin reference for the full list of available configurations.

iOS

To start using GetSocial, you have to add and configure GetSocial installer script to your Xcode project. The script adds GetSocial frameworks to the project and configures app entitlements, plist files, and Xcode project settings.

To add GetSocial installer script:

  1. Run pod install to update dependencies.
  2. In your Xcode project go to Project Settings --> select target you want to modify --> Build Phases tab.
  3. Create new Run Script phase with the content:

     "$PROJECT_DIR/getsocial-sdk7.sh" --app-id="your-getsocial-app-id"
  4. Move Run Script phase before the Compile Sources phase.

  5. Build your project.

!!! tip "Project Backups" GetSocial installer script creates a backup of your project.pbxproj file every time it is executed. If something goes wrong, you can always roll back to the previous version.

!!! tip "Source Control Configuration" We suggest adding .backup files under .xcodeproj to ignore list to keep your version control history clean.

Start Using GetSocial

GetSocial UI

At this point, you should be able to start using GetSocial.

GetSocial UI library contains easy to customize views for all GetSocial features, e.g. code below will create and show GetSocial Smart Invites view:

import {GetSocialUI, InvitesView} from 'getsocial-react-native-sdk';
...
InvitesView().show();

SDK Initialization

GetSocial SDK is auto-initialized, just provide a GetSocial App Id in the Gradle plugin on Android, or as a parameter to the iOS Installer Script on iOS, and we will do the magic.

If you want to be notified about initialization complete, you can register a listener, which will be invoked when SDK gets initialized or invoked immediately if it is already initialized:

import {GetSocial} from 'getsocial-react-native-sdk';
...
GetSocial.addOnInitializedListener(() => {
    // GetSocial SDK is ready to use
});

Send your first invite

import {Invites} from 'getsocial-react-native-sdk';
...

Invites.send(nil, "email", () => {
    console.log('Invitation via email was sent');
}, () => {
    console.log('Invitation via email was cancelled');
}, (error) => {
    console.log('Failed to send invitation via email failed, error: ' + error.message);
});

changelog

v7.12.6 - May 23, 2023

  • Fixed: chat message properties were not being stored correctly
  • Fixed: error when trying to fetch followers count

v7.12.5 - Feb 3, 2023

  • New: Support includeComments method in ActivitiesQuery
  • New: Support (up to 3) comments as part of the Activity
  • New: Support posting nested comments (Add Comment type to CommunitiesEntityType)

v7.12.4 - Oct 7, 2022

  • New: Search for Topic/Group/Label/Hashtag/User followers and group members by name
  • New: Rejected status for Group Members

v7.12.3 - Sep 16, 2022

  • Expose ActivityButton, Tag, NotificationContext and others.

v7.12.2 - Sep 7, 2022

  • Overall improvements.

v7.12.1 - Aug 18, 2022

  • Fix: Map returned by getUsersByIds and areGroupMembers methods

v7.12.0 - Jul 27, 2022

  • New: Support for blocked users

v7.11.0 - Jun 21, 2022

  • New: support for verified users
  • Overall improvements.

v7.10.0 - May 12, 2022

  • New: Global search (beta) for activities, labels, hashtags, users, groups and topics

v7.9.2 - Apr 19, 2022

  • Fixed: AddGroupMembersQuery is now correctly parsed.
  • Fixed: addGroupMembers was calling the wrong method.
  • Fixed: JoinGroupQuery is now correctly parsed.
  • Fixed: joinGroup was calling the wrong method.

v7.9.1 - Mar 24, 2022

  • Fixed: make use of HTTPS for maven repository.
  • Fixed: remove warnings.

v7.9.0 - Feb 17, 2022

  • New: improved find for labels and hashtags.
  • New: find topics and groups by labels and properties.
  • New: find activities by content, labels and properties
  • New: get suggested users based on user connections and trending users
  • New: follow labels and tags to see related content in the user’s timeline.
  • New: bookmark activities and get all the bookmarked activities from the user.
  • New: get reacted or voted activities from the user.
  • New: filter activities by mentions of a user or the app.
  • Fixed: added missing PendingIntent.FLAG_IMMUTABLE flag to which caused crash on Android 12.
  • Fixed: isBanned() is now correctly updated if the ban expiration happens while the user is using the app.
  • Fixed: Push Notifications were not opening the app on Android 12.
  • Fixed: error when trying to open Native Share option on Android 12.
  • Fixed: Push Notifications listeners not working correctly on Android 12.
  • Overall improvements.

v7.3.2 - Oct 26, 2021

  • New: added BanInfo to CurrentUser.

v7.3.1 - Oct 14, 2021

  • Overall improvements.

v7.3.0 - Oct 1, 2021

  • New: added support for trusted identities. read more.
  • New: added possibility to filter for trending activities, topics and groups.

v7.2.3 - Sep 23, 2021

  • Fix issue with not invoked Push Notification listener.

v7.2.2 - Sep 17, 2021

  • Fix issue with limit parameter when fetching chat objects.

v7.2.1 - Aug 12, 2021

  • Fix issue with incorrect Android SDK version.

v7.2.0 - Jul 21, 2021

v7.1.5 - May 18, 2021

  • Fix link parameters issue when creating invite URL on iOS.

v7.1.4 - Mar 25, 2021

  • Fix providerId casing issue when adding an identity.

v7.1.3 - Mar 22, 2021

  • Added new method to refresh current user.
  • Overall improvements.

v7.1.2 - Mar 17, 2021

  • Fix issue when creating invite content.

v7.1.1 - Feb 12, 2021

  • Fix issue when posting Activity

v7.1.0 - Feb 12, 2021

  • Added Groups and Chat features.
  • Fix issue with AnnouncementsQuery.

v7.0.15 - Feb 10, 2021

  • Fix issue with background mode on iOS.

v7.0.14 - Feb 10, 2021

  • Fix incorrect result of isAnonymous() call.

v7.0.13 - Feb 8, 2021

  • Fix issue with removing Activities on Android.

v7.0.12 - Feb 8, 2021

  • Fix issue with removing Activities on iOS.

v7.0.11 - Feb 1, 2021

  • Fix issues with adding - removing reactions.

v7.0.10 - Feb 1, 2021

  • Fix Referral data edge case issue on Android.

v7.0.9 - Jan 22, 2021

  • Fix Bridge is not set issue on iOS when reloading JS content.

v7.0.8 - Jan 18, 2021

  • Fix issue when sending custom invite content without default UI.

v7.0.7 - Dec 29, 2020

  • Fix issue when phone number used as identity access token.

v7.0.6 - Dec 16, 2020

  • Fix issue with referral data listener on Android.

v7.0.5 - Dec 9, 2020

  • Fix issue with referral data listener on iOS.

v7.0.4 - Dec 1, 2020

  • Fix typo in Podspec.

v7.0.3 - Dec 1, 2020

  • Fix issue with referral data listener.

v7.0.2 - Dec 1, 2020

  • Overall improvements.