Nojoom 1.0.8
dotnet add package Nojoom --version 1.0.8
NuGet\Install-Package Nojoom -Version 1.0.8
<PackageReference Include="Nojoom" Version="1.0.8" />
<PackageVersion Include="Nojoom" Version="1.0.8" />
<PackageReference Include="Nojoom" />
paket add Nojoom --version 1.0.8
#r "nuget: Nojoom, 1.0.8"
#:package Nojoom@1.0.8
#addin nuget:?package=Nojoom&version=1.0.8
#tool nuget:?package=Nojoom&version=1.0.8
Nojoom Lifestyle SDK for .NET MAUI
Official .NET MAUI bindings for the Nojoom Lifestyle SDK. A single package embeds the Nojoom offers / coupons experience into a MAUI app on both Android and iOS.
You give the SDK a session token; it renders its entire UI itself — home, offer categories, merchant listings, offer details with maps, coupons, favourites, redemption (QR / code), and contacts. Your app builds none of those screens.
| Target | Included |
|---|---|
net10.0-android |
Managed binding + all runtime AARs (Jetpack Compose, Coil, Google Maps, Huawei Map Kit, Retrofit/OkHttp, Nimbus JWT) |
net9.0-ios |
Managed binding + native NojoomLifestyles.xcframework (device + simulator slices) |
One PackageReference covers both platforms.
Install
dotnet add package Nojoom --version 1.0.8
<PackageReference Include="Nojoom" Version="1.0.8" />
Requirements
- .NET 9 with the MAUI /
androidandiosworkloads. - Android minimum API level 24; iOS minimum 13.0.
Host-app configuration
These cannot be carried by the package and must be supplied by the consuming app.
Android — required NuGet pins (build/runtime conflict fix)
com.google.gson and a few AndroidX versions conflict with what Microsoft.Maui.Core pins. Add
these to your app project or you'll hit NU1107 at build or a crash at runtime:
<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" Version="2.11.0.1" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData.Core" Version="2.11.0.1" />
<PackageReference Include="Xamarin.AndroidX.SavedState.SavedState.Ktx" Version="1.5.0.1" />
</ItemGroup>
The NU1608 "version outside constraint" warnings these produce are expected and benign.
(Non-MAUI Xamarin.Android hosts must also add the GoogleGson NuGet ≥ 2.10.1 — a MAUI app
already provides it transitively.)
The SDK's networking stack also needs com.squareup.okio (Okio) present at runtime. Apps using
Firebase Analytics/Messaging already get it transitively via Xamarin.AndroidX.DataStore.*; if
yours doesn't, add Square.OkIO.JVM (≥ 3.17.0.1) yourself.
As of 1.0.7, Xamarin.AndroidX.NavigationEvent (supplies androidx.navigationevent.* for the
SDK's NavHost) ships as a direct package dependency — no host action needed. If you're on 1.0.5
or earlier and see java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/navigationevent/NavigationEventDispatcherOwner; at launch, upgrade, or add
Xamarin.AndroidX.NavigationEvent (1.0.2.1) yourself.
Crash on launch — IllegalStateException: Module with the Main dispatcher is missing: this
means your app resolved a different version of Xamarin.KotlinX.Coroutines.Android than
Xamarin.KotlinX.Coroutines.Core.Jvm (usually because another dependency — Firebase, Room,
WorkManager, anything that touches Kotlin coroutines — pulled one of the two to a different
version than the other). It's a host-side dependency conflict, not something inside this package.
Pin both explicitly to the same version in your app, and make sure the pins above are current —
stale/lower pin values can force the exact kind of conflict that leads here if worked around by
hand instead of raised.
Android — Google Maps API key (required)
The SDK shows a Google Map on offer-detail screens. Add your key to the host
AndroidManifest.xml (play-services-maps reads it from the host, never the SDK). Without it the
app hard-crashes with IllegalStateException: API key not found when a map opens.
<application ...>
<meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_MAPS_KEY" />
</application>
Huawei devices additionally need an AppGallery Connect project (agconnect-services.json + Map
Kit key) in the host app.
iOS
No extra references or pins — the native NojoomLifestyles.xcframework ships inside the package
and links automatically.
Initialize & launch
The one runtime input is a session token from your own login flow. No API key or encryption
keys are needed — those are embedded in the SDK. Initialization is async — only show the SDK UI
after onSuccess.
Which backend does the SDK talk to?
If you do nothing, the SDK talks to the UAT environment
(https://uat.aideasolution.com/api/). You only need to think about this once you're given a
different URL (e.g. production) — at that point, pass it as one extra argument exactly where
shown in the two code blocks below (CreateIntent on Android, Initialize on iOS). There's
nothing else to configure, no separate file or setting — it's that one line, right where you
already call the SDK.
⚠️ One rule: wherever you get the session
tokenfrom (your login API, or a test endpoint) must be the same backend you pass here. A token from one backend is always rejected on a different one — the SDK reports that asonSessionExpired/onError, which can look like a bug elsewhere but really just means the two don't match.
Android — launch NojoomActivity
using Com.Nojoom.Lifestyles.Public;
using Microsoft.Maui.ApplicationModel;
var activity = Platform.CurrentActivity;
// 2 arguments (token only) = talks to UAT automatically. To use a different backend,
// add the URL as a 3rd argument, e.g.:
// NojoomActivity.CreateIntent(activity, token, "https://your-prod-host/api/")
var intent = NojoomActivity.CreateIntent(activity, token);
activity.StartActivity(intent); // NojoomActivity self-initializes and renders its own UI
iOS — initialize, present on success
using NojoomLifestyles;
using Microsoft.Maui.ApplicationModel;
using UIKit;
NojoomSDK.Initialize(
token,
baseUrl: null, // null = UAT automatically. Replace with e.g. "https://your-prod-host/api/"
// to use a different backend — that's the only change needed.
onSuccess: () => MainThread.BeginInvokeOnMainThread(() =>
{
// Grab the app's top-most view controller to present from.
var root = UIApplication.SharedApplication.KeyWindow?.RootViewController;
while (root?.PresentedViewController is not null)
root = root.PresentedViewController;
var vc = NojoomSDK.MakeContentViewController();
vc.ModalPresentationStyle = UIModalPresentationStyle.FullScreen;
root?.PresentViewController(vc, animated: true, completionHandler: null);
}),
onError: message => { /* show error, prompt re-login */ },
onSessionExpired: null,
onRefreshToken: null,
onOfferRedeemed: null);
Session callbacks (optional, both platforms)
The SDK raises six host callbacks. In the native Kotlin/Swift API they are all just
parameters of initialize, side by side. The .NET binding keeps them together too — as the
six methods of INojoomSDKCallback (Android direct-init) — with two shape differences
forced by the binding layer, noted in the last column:
| Callback | When | Android via NojoomActivity |
Android via NojoomSDK.Initialize(context, config, callback) |
iOS |
|---|---|---|---|---|
onSuccess |
SDK ready | handled internally | INojoomSDKCallback.OnSuccess() |
Initialize arg |
onError |
init failed | Activity finishes itself | INojoomSDKCallback.OnError(msg) |
Initialize arg |
onSessionExpired |
token dead, unrefreshable | SetOnSessionExpired(listener) |
INojoomSDKCallback.OnSessionExpired() |
Initialize arg |
onRefreshToken |
401/403 | SetOnRefreshToken(listener) |
INojoomSDKCallback.OnRefreshToken(cb) |
Initialize arg |
onOfferRedeemed |
offer redeemed | SetOnOfferRedeemed(listener) |
INojoomSDKCallback.OnOfferRedeemed(token) |
Initialize arg |
onDismiss |
user tapped ✕ | no hook — the Activity finish()es, your app resumes |
INojoomSDKCallback.OnDismiss() — same interface, right beside the others |
NojoomSDK.SetOnDismiss(handler) — a separate static call, not an Initialize arg |
Why onDismiss looks different in .NET:
NojoomActivityregisters redeem/refresh/expired throughSetOn*statics and simply has no close callback — closing is the Activity finishing, so there is nothing to deliver.- iOS: the Objective-C bridge's
initializeselector was already at seven arguments with a nested completion block; adding an eighth block param produced invalid generated C#. So the bridge exposesonDismissassetOnDismiss:instead. The Swift-nativeNojoomSDK.initializestill takes it as a parameter, like Kotlin — only the ObjC/.NET surface splits it out. - Android
INojoomSDKCallback: no difference —OnDismiss()is the sixth method on the same interface as the other five. Implement it exactly likeOnOfferRedeemed.
// iOS — the close button, hooked separately (before presenting MakeContentViewController)
NojoomSDK.SetOnDismiss(() => MainThread.BeginInvokeOnMainThread(() =>
UIApplication.SharedApplication.KeyWindow?.RootViewController?
.DismissViewController(true, null)));
Registering redeem / refresh / session-expired on the NojoomActivity path
Register these before launching NojoomActivity:
NojoomActivity.SetOnOfferRedeemed(new RedeemListener(token => { /* forward token to backend */ }));
NojoomActivity.SetOnRefreshToken(new RefreshTokenListener(async () => await GetFreshTokenAsync()));
RedeemListener and RefreshTokenListener are small adapter classes you add to your app —
each wraps a C# delegate in the SDK's Java interface and must extend Java.Lang.Object to cross
the JNI boundary. Paste these two classes as-is:
using Com.Nojoom.Lifestyles.Public;
// Adapts an Action<string> to INojoomRedeemListener.
sealed class RedeemListener : Java.Lang.Object, INojoomRedeemListener
{
readonly Action<string> _onOfferRedeemed;
public RedeemListener(Action<string> onOfferRedeemed) => _onOfferRedeemed = onOfferRedeemed;
public void OnOfferRedeemed(string token) => _onOfferRedeemed(token);
}
// Adapts an async Func<Task<string?>> to INojoomRefreshTokenListener.
// The SDK calls OnRefreshToken on the main thread and blocks a background thread (up to 30s)
// waiting for the reply, so run the refresh OFF the main thread and deliver via
// result.OnToken(...) from whatever thread it finishes on (pass null if the refresh failed).
sealed class RefreshTokenListener : Java.Lang.Object, INojoomRefreshTokenListener
{
readonly Func<Task<string?>> _onRefreshToken;
public RefreshTokenListener(Func<Task<string?>> onRefreshToken) => _onRefreshToken = onRefreshToken;
public void OnRefreshToken(INojoomTokenCallback result) => _ = Task.Run(async () =>
{
string? newToken;
try { newToken = await _onRefreshToken(); } catch { newToken = null; }
result.OnToken(newToken);
});
}
iOS — filling in the session callbacks
The iOS example above already uses the full Initialize overload (with baseUrl) but passed
null for the three optional callbacks. Fill them in like this:
NojoomSDK.Initialize(
token,
baseUrl: null, // or "https://your-prod-host/api/" — same as the example above
onSuccess: () => { /* present MakeContentViewController() */ },
onError: message => { /* show error */ },
onSessionExpired: () => { /* prompt re-login */ },
onRefreshToken: completion => Task.Run(async () =>
{
string? fresh;
try { fresh = await GetFreshTokenAsync(); } catch { fresh = null; }
completion.Provide(fresh); // any thread; null = refresh failed
}),
onOfferRedeemed: redeemToken => { /* forward opaque token to your backend */ });
// The close (✕) button is separate — it is NOT a parameter of Initialize:
NojoomSDK.SetOnDismiss(() => { /* dismiss/pop MakeContentViewController() */ });
Pass null for any callback you don't need. SetOnDismiss is optional too — without it the
SDK's view controller dismisses itself.
Behaviour notes
- The SDK owns the whole screen. Tapping its close (✕) button: via
NojoomActivitythe Activity finishes itself; viaNojoomSDK.Initialize(context, config, callback)yourINojoomSDKCallback.OnDismiss()fires; on iOS yourNojoomSDK.SetOnDismisshandler fires (or the view controller pops itself if you set none). The SDK stays initialised after a dismiss. - Host app-identity validation is enforced in release builds of
Nojoom 1.0.8(Androidom.ooredoo; iOSom.nawras.mynawras/com.cts.selfcare.ooredoo). It is skipped for debuggable Android hosts and the iOS Simulator, so day-to-day integration is unaffected. - Device-integrity checks run in log-only mode by default (never deny service); opt into
blocking with
NojoomConfig.integrityPolicy = NojoomIntegrityPolicy.Block(Android). - Screenshot/recording blocking is off by default — enable it per launch with
NojoomConfig.blockScreenCapture = true/NojoomActivity.CreateIntent's 4th argument. - Token carries a ~1-hour backend expiry + configurable idle timeout (
sessionTimeoutMinutes, default 30).
NojoomConfig (Android)
NojoomActivity.CreateIntent builds one internally. If you call
NojoomSDK.Initialize(context, config, callback) directly, construct it as:
new NojoomConfig(token) // token only
new NojoomConfig(token, baseUrl) // token + backend URL
new NojoomConfig(token: token, blockScreenCapture: true, sessionTimeoutMinutes: 30,
diagnosticsLogging: false, integrityPolicy: NojoomIntegrityPolicy.LogOnly,
playIntegrityCloudProjectNumber: null, baseUrl: "https://…/api/")
C# named arguments on these constructors work as of 1.0.8 (≤ 1.0.7 emitted p0, p1, …
parameter names, so named-argument calls failed to compile with CS1739). iOS has no
NojoomConfig — pass token / baseUrl straight to Initialize.
API surface
Android (Com.Nojoom.Lifestyles.Public) — NojoomActivity.CreateIntent(context, token[, baseUrl[, blockScreenCapture]]),
SetOnOfferRedeemed, SetOnRefreshToken, SetOnSessionExpired; NojoomSDK.Initialize(context, config, callback) / IsInitialized / Reset; NojoomConfig, NojoomIntegrityPolicy;
INojoomSDKCallback (OnSuccess/OnError/OnSessionExpired/OnRefreshToken/OnOfferRedeemed/OnDismiss),
INojoomRedeemListener, INojoomRefreshTokenListener, INojoomTokenCallback. (NojoomSDKView
is intentionally not bound — use NojoomActivity.)
iOS (NojoomLifestyles) — NojoomSDK.Initialize(token, onSuccess, onError),
NojoomSDK.Initialize(token, baseUrl, onSuccess, onError, onSessionExpired, onRefreshToken, onOfferRedeemed), MakeContentViewController(), SetOnDismiss(handler), IsInitialized,
Reset(), NojoomTokenCompletion.Provide(token).
License
Proprietary. All rights reserved. See LICENSE.txt.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-ios18.0 is compatible. net10.0-android36.0 is compatible. net10.0-ios was computed. |
-
net10.0-android36.0
- Xamarin.AndroidX.Activity (>= 1.10.1.3)
- Xamarin.AndroidX.Compose.Runtime.Annotation.Android (>= 1.10.4.1)
- Xamarin.AndroidX.NavigationEvent (>= 1.0.2.1)
- Xamarin.Google.Android.Play.Core.Common (>= 2.0.4.7)
- Xamarin.Google.Android.Play.Integrity (>= 1.4.0.6)
- Xamarin.GooglePlayServices.Base (>= 118.2.0.6)
- Xamarin.GooglePlayServices.Basement (>= 118.7.1.1)
- Xamarin.GooglePlayServices.Maps (>= 118.2.0.2)
- Xamarin.GooglePlayServices.Tasks (>= 118.3.2.1)
- Xamarin.Kotlin.StdLib (>= 2.3.10.1)
- Xamarin.KotlinX.Coroutines.Android (>= 1.10.2.3)
- Xamarin.KotlinX.Serialization.Core.Jvm (>= 1.10.0.1)
-
net9.0-ios18.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.