nearit / android-sdk Goto Github PK
View Code? Open in Web Editor NEWNearIT SDK for Android apps
License: MIT License
NearIT SDK for Android apps
License: MIT License
Dates are returned as string objects, it'd be useful to have a Date returned instead.
When the content has file attachments (images, pdf or audio) it doesn't get delivered through push.
sendNotifiedTracking
should have protected visibility to allow
subclasses to invoke it
In the "In-app Content" section, the description of the object methods is not up-to-date with the migration from public getters to public fields (necessary for Xamarin wrapper)
Here the stacktrace:
Fatal Exception: java.lang.RuntimeException: Unable to stop service it.near.sdk.geopolis.geofences.GeoFenceService@297a01e3: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' on a null object reference at android.app.ActivityThread.handleStopService(ActivityThread.java:3363) at android.app.ActivityThread.access$2300(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1552) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' on a null object reference at it.near.sdk.geopolis.geofences.GeoFenceService.stopGeofencing(GeoFenceService.java:261) at it.near.sdk.geopolis.geofences.GeoFenceService.stopAllGeofences(GeoFenceService.java:226) at it.near.sdk.geopolis.geofences.GeoFenceService.onDestroy(GeoFenceService.java:123) at android.app.ActivityThread.handleStopService(ActivityThread.java:3346) at android.app.ActivityThread.access$2300(ActivityThread.java:177) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1552) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5951) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
In order to customise the push notification icon I must implement my own service and receiver.
It would be nice if it will be an utility method to accomplish this.
To avoid ConcurrentModificationException use CopyOnWriteArrayList over syncronized list
Here's the stacktrace
Fatal Exception: java.lang.RuntimeException: Unable to create application com.XXXXXX: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6320)
at android.app.ActivityThread.access$1800(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1860)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7225)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at it.near.sdk.utils.AppVisibilityDetector.checkIsMainProcess(SourceFile:91)
at it.near.sdk.utils.AppVisibilityDetector.init(SourceFile:50)
at it.near.sdk.geopolis.beacons.AltBeaconMonitor.initAppLifecycleMonitor(SourceFile:150)
at it.near.sdk.geopolis.GeopolisManager.initLifecycle(SourceFile:273)
at it.near.sdk.NearItManager.initLifecycleMethods(SourceFile:205)
at it.near.sdk.NearItManager.init(SourceFile:107)
at com.XXXXXX.onCreate(SourceFile:25)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1036)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6317)
at android.app.ActivityThread.access$1800(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1860)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7225)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Switch from IntentService to JobIntentService for customizing the background event
To support frameworks that might not instantiate the nearItManager on application startup due to lazy loading (e.g. dagger) separate the nearItManager object instantiation and the binding of context to catch application lifecycles.
When the app is in the foreground, make the built-in notification "heads-up" so they are more noticeable.
Configuration like android:allowBackup and android:label shouldn't be in the SDK manifest, since they leak in the app.
Hi!
Gradle gives me strange sync errors about a com.google.android.gms:play-services-basement
version mismatch. Googling the error I had to add this line in the app build.gradle file to suppress the error. I think it is related to a Google Play Services version mismatch, but I couldn't find the cause.
This is my current app build.gradle:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'net.danlew:android.joda:2.9.9'
implementation 'com.plattysoft.leonids:LeonidsLib:1.3.2'
implementation 'com.android.volley:volley:1.1.1'
implementation 'it.near.sdk:nearit:2.10.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.38.1'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
Instead of making the developer include either the built-in notification receiver or a custom made notification receiver, make the built-in receiver automatically included in the manifest so extra work is only needed when customizing.
This step in the integration process should now be no longer needed
Enable Background Notification
To enable our built-in background system notifications for both location and push triggers, add this in your app manifest application element.
<!-- built in background receiver -->
> <receiver
> android:name="it.near.sdk.recipes.background.NearItBroadcastReceiver"
> android:exported="false">
> <intent-filter>
> <action android:name="it.near.sdk.permission.GEO_MESSAGE" />
> <category android:name="android.intent.category.DEFAULT" />
> </intent-filter>
> <intent-filter>
> <action android:name="it.near.sdk.permission.PUSH_MESSAGE" />
> <category android:name="android.intent.category.DEFAULT" />
> </intent-filter>
> </receiver>
The receiver appears to not receive intents.
When using NearIT receivers in an app Manifest, Android Studio warns about badly formatted package names of the library.
Near.parseContent has the side-effect to trigger the callback, but it would be nice to have a method that only checks if the intent has triggered from near
The coupon object has a method that can return a null object, but is not annotated with @nullable
Update play services to latest version.
Coupons don't have a "redeemable from" field
Here the stacktrace:
Fatal Exception: java.lang.NullPointerException
at it.near.sdk.reactions.contentplugin.model.Image.toImageSet(Image.java:22)
at it.near.sdk.reactions.contentplugin.ContentReaction.formatLinks(ContentReaction.java:210)
at it.near.sdk.reactions.contentplugin.ContentReaction.formatLinks(ContentReaction.java:202)
at it.near.sdk.reactions.contentplugin.ContentReaction.access$400(ContentReaction.java:37)
at it.near.sdk.reactions.contentplugin.ContentReaction$2.onSuccess(ContentReaction.java:107)
at com.loopj.android.http.JsonHttpResponseHandler$1$1.run(JsonHttpResponseHandler.java:152)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5476)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(NativeStart.java)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.