Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2025-01-21 13:35:59 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a84375f046d726160bd610ad8b3ca67725043622
a84375f0
1 parent
db376f75
SDK INIT changes
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
15 deletions
warply_android_sdk/src/main/AndroidManifest.xml
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/callbacks/WarplyReadyCallback.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyInitializer.java
warply_android_sdk/src/main/AndroidManifest.xml
View file @
a84375f
...
...
@@ -237,13 +237,13 @@
<!-- </intent-filter>-->
<!-- </receiver>-->
<receiver
android:name=
".receivers.BluetoothStateChangeReceiver"
android:exported=
"false"
>
<intent-filter
>
<action
android:name=
"android.bluetooth.adapter.action.STATE_CHANGED"
/
>
</intent-filter
>
</receiver
>
<!-- <receiver-->
<!-- android:name=".receivers.BluetoothStateChangeReceiver"-->
<!-- android:exported="false">--
>
<!-- <intent-filter>--
>
<!-- <action android:name="android.bluetooth.adapter.action.STATE_CHANGED" />--
>
<!-- </intent-filter>--
>
<!-- </receiver>--
>
<receiver
android:name=
".receivers.WarplyInAppNotificationReceiver"
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
View file @
a84375f
...
...
@@ -137,6 +137,19 @@ public enum Warply {
});
}
public
static
WarplyInitializer
getWarplyInitializer
(
Context
context
,
WarplyReadyCallback
callback
)
{
return
new
WarplyInitializer
(
context
,
true
,
callback
,
new
WarplyInitializer
.
WarplyInitCallback
()
{
@Override
public
void
onInit
(
Context
context
)
{
if
(
context
!=
null
)
{
INSTANCE
.
mContext
=
context
.
getApplicationContext
();
}
initInternal
(
context
);
}
});
}
private
static
void
initInternal
(
Context
context
)
{
if
(
/*isInitialized()*/
context
==
null
)
{
INSTANCE
.
check
();
...
...
@@ -1980,7 +1993,7 @@ public enum Warply {
@Override
public
void
onServerPreferencesReceived
()
{
// changeLocationSettings(true);
initBeaconsApplicationIfNeed
();
//
initBeaconsApplicationIfNeed();
WarplyUserManager
.
rewriteTags
();
}
};
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/callbacks/WarplyReadyCallback.java
View file @
a84375f
...
...
@@ -7,4 +7,6 @@ public interface WarplyReadyCallback {
void
onWarplyInitTimeOut
();
void
onWarplyPermissionsDenied
();
default
void
onWarplyInitialized
()
{};
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyInitializer.java
View file @
a84375f
...
...
@@ -16,6 +16,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.dexter.listener.DexterError
;
import
ly.warp.sdk.dexter.listener.PermissionDeniedResponse
;
import
ly.warp.sdk.io.callbacks.WarplyReadyCallback
;
...
...
@@ -65,6 +66,24 @@ public class WarplyInitializer extends Thread /*implements ActivityCompat.OnRequ
stopThreadLock
.
set
(
true
);
}
public
WarplyInitializer
(
Context
context
,
boolean
isInternal
,
WarplyReadyCallback
readyCallback
,
WarplyInitCallback
initCallback
)
{
// this.mPermissionsResultRequested = false;
this
.
mContext
=
context
;
this
.
mReadyCallback
=
readyCallback
;
this
.
mInitCallback
=
initCallback
;
if
(
mMainThreadHandler
==
null
)
{
mMainThreadHandler
=
new
Handler
(
Looper
.
getMainLooper
());
}
if
(
stopThreadLock
==
null
)
{
stopThreadLock
=
new
AtomicBoolean
(
true
);
}
stopThreadLock
.
set
(
true
);
init
();
}
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
...
...
@@ -159,16 +178,40 @@ public class WarplyInitializer extends Thread /*implements ActivityCompat.OnRequ
// ===========================================================
public
synchronized
void
init
()
{
stopThreadLock
.
set
(
true
);
mInitCallback
.
onInit
(
mContext
);
try
{
super
.
start
();
// call run()
}
catch
(
IllegalThreadStateException
e
)
{
if
(
WarpConstants
.
DEBUG
)
{
e
.
printStackTrace
();
/* New code */
if
(
Warply
.
INSTANCE
.
mContext
!=
null
)
{
if
(
mReadyCallback
!=
null
)
{
mMainThreadHandler
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
mReadyCallback
.
onWarplyInitialized
();
}
});
}
}
else
{
mInitCallback
.
onInit
(
mContext
);
try
{
super
.
start
();
// call run()
}
catch
(
IllegalThreadStateException
e
)
{
if
(
WarpConstants
.
DEBUG
)
{
e
.
printStackTrace
();
}
}
}
/* New code */
/* Old code */
// mInitCallback.onInit(mContext);
// try {
// super.start(); // call run()
// } catch (IllegalThreadStateException e) {
// if (WarpConstants.DEBUG) {
// e.printStackTrace();
// }
// }
/* Old code */
}
public
synchronized
void
initWithPermissions
(
Activity
activity
)
{
...
...
Please
register
or
login
to post a comment