Skip to content

Commit

Permalink
change structure
Browse files Browse the repository at this point in the history
  • Loading branch information
MoustafaEid committed Jun 7, 2024
1 parent 09f2646 commit 66aebf4
Show file tree
Hide file tree
Showing 55 changed files with 389 additions and 143 deletions.
Binary file added .gradle/8.7/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/8.7/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/8.7/checksums/sha1-checksums.bin
Binary file not shown.
Empty file.
Binary file added .gradle/8.7/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/8.7/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/8.7/gc.properties
Empty file.
Binary file added .gradle/8.8/checksums/checksums.lock
Binary file not shown.
Binary file added .gradle/8.8/checksums/md5-checksums.bin
Binary file not shown.
Binary file added .gradle/8.8/checksums/sha1-checksums.bin
Binary file not shown.
Empty file.
Binary file added .gradle/8.8/executionHistory/executionHistory.bin
Binary file not shown.
Binary file added .gradle/8.8/executionHistory/executionHistory.lock
Binary file not shown.
Binary file added .gradle/8.8/fileChanges/last-build.bin
Binary file not shown.
Binary file added .gradle/8.8/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added .gradle/8.8/fileHashes/fileHashes.lock
Binary file not shown.
Empty file added .gradle/8.8/gc.properties
Empty file.
Binary file added .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 2 additions & 0 deletions .gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#Thu Jun 06 20:25:43 PDT 2024
gradle.version=8.8
Binary file added .gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file added .gradle/file-system.probe
Binary file not shown.
Empty file added .gradle/vcs-1/gc.properties
Empty file.
Binary file added .gradle/workspace-id.txt
Binary file not shown.
Binary file added .gradle/workspace-id.txt.lock
Binary file not shown.
1 change: 1 addition & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
48 changes: 48 additions & 0 deletions android/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Laudspeaker Android SDK Integration
## Setup
To setup Laudspeaker Android SDK perform these steps:
- Add laudspeaker dependency:
```
implementation "........."
```
- Perform Grandle sync
- Add required permissions to AndroidManifest.xml:
```xml
<uses-permission android:name="android.permission.INTERNET" />
```
- setup firebase using instructions mentioned in [Firebase setup guide](https://firebase.google.com/docs/android/setup)
## Example
```java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// initialize firebase integration
FirebaseApp.initializeApp(this);

...

// create instance
LaudspeakerAndroid laudspeakerAndroid = new LaudspeakerAndroid(getPreferences(MODE_PRIVATE));

// describe customer's unique properties for identification
Map<String, Object> uniquePropertiesMap = new HashMap<>();
uniquePropertiesMap.put("email", "email@gmail.com");

// implement onConnect listener
ConnectListener connectListener = () -> {
// identify the customer
laudspeakerAndroid.identify(uniquePropertiesMap);
// retrive and assign customer's FCM token
laudspeakerAndroid.sendFCMToken();
};

laudspeakerAndroid.onConnected(connectListener);

// connect to laudspeaker services using your api token and host
try {
laudspeakerAndroid.connect("YOUR_API_KEY", "https://laudspeaker.com");
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
```
43 changes: 43 additions & 0 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
id("com.android.library")
}

android {
namespace = "com.laudspeaker.android"
compileSdk = 34

defaultConfig {
minSdk = 26

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

dependencies {

implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
implementation("io.socket:socket.io-client:2.1.0")
implementation("com.google.firebase:firebase-installations:17.2.0")
implementation("com.google.firebase:firebase-messaging:23.4.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("com.google.code.gson:gson:2.10") // Use the latest version available
classpath 'com.android.tools.build:gradle:8.7.0'
}
Empty file added android/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions android/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
File renamed without changes.
30 changes: 2 additions & 28 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,32 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.library")
}

repositories {
mavenCentral()
}

android {
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
id("com.google.gms.google-services") version "4.4.0" apply false
}

dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.android.material:material:1.11.0")
implementation("io.socket:socket.io-client:2.1.0")
implementation("com.google.firebase:firebase-installations:17.2.0")
implementation("com.google.firebase:firebase-messaging:23.4.0")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("com.google.code.gson:gson:2.10") // Use the latest version available
classpath 'com.android.tools.build:gradle:8.7.0'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
13 changes: 7 additions & 6 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Fri Jan 19 13:03:33 EET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 66aebf4

Please sign in to comment.