Xamarin

Integration

Import the NotifyVisitors SDK in your project

Extract the file and add the extracted library project to your project Solution. Double click on Reference and goto PROJECTS tab and select notifyvisitors and click on OK button.Now Notifyvisitors should be shown in Reference folder as following image.

Configure Info.plist

Goto info.plist click on Source tab

Add the following keys with their required values

Add NSAppTransportSecurity as a Dictionary. Then add a Subkey NSAllowsArbitraryLoadsas Boolean and set its value to YES.

Add URL types as an Array. Under Item 0, add two new items : URL Identifier (string) and URL schemes (Array). Add your company identifier for the URL Identifier and “YourAppScheme” for Item 0 of URL schemes.

Add NSLocationAlwaysUsageDescription as a String. Configure the message you want to show in alert box for asking user permission for geofencing.

Notification Center

You can show a list of push notifications received in an In-app Notification Center. Expiry of the notifications can be set from the panel.

To launch In-app notification center you can call the following method.

iOS

notifyvisitors.NotifyVisitorsNotificationCentre ();

Geofencing

To handle the geofencing notifications in background state and Inactive state of application, add the following codes in applicationDidEnterBackground and applicationDidBecomeActive methods respectively.

USER_ID(NSString)Setting the Unique ID is a critical piece to tie a user across devices and installs/uninstalls as well across all platforms (i.e. iOS, Android, Windows, The Web). Unique ID can be something like an email ID, a username (unique), or any Backend generated ID.

USER_ATTRIBUTES (NSMutableDictionary) You can set the user attributes like name, email, mobile number. These can then be used to send personalised content in notifications. But these attributes can not be used in segmenting the users.

Default Attribute Names -

name

email

mobile

You can also pass your custom attributes like username, birthday, first name, last name.

IMPORTANT :

Attribute Names should contain only alpha-numerics, white spaces or ‘_’ ; No other special characters are allowed.
Recommended names - ‘first_name’, ‘last_name’

Sample Code

Track Events

Event API enables you to record any actions your users perform, along with any properties that describe the action. These are then used for analytics, user segmentation or to trigger engagements or other actions.

EVENT_NAME (string)Name of the event like sale, register. Event names should contain only alpha-numerics, white spaces or ‘_’ ; No other special characters are allowed.

EVENT_ATTRIBUTES (NSMutableDictionary)Attributes associated with the event. Attribute values should be passed in the form of Javascript strings, booleans and numbers respectively. Similarly date attribute values are expected in the form of Javascript date objects.

IMPORTANT :

Attribute Names should contain only alpha-numerics, white spaces or ‘_’ ; No other special characters are allowed.
Recommended names - ‘category’, ‘price_usd’

LIFETIME_VALUE (integer)The score you would like to reward the user on performing this event like 10, 100.

SCOPE (integer) The scope of the event, whether it should be tracked every time it is called, or per session, or once in a lifetime. This parameter is used to minimise the duplication of data in analytics. It is an integer whose values are :