Git Product home page Git Product logo

noob-programmer1 / noober-2.0 Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 131 KB

Noober 2.0 is the second version of Noober, a debugging library designed specifically for iOS. This version is powered by Kotlin Multiplatform Mobile (KMM) and Compose Multiplatform, allowing you to use a single library for both android and iOS

License: Apache License 2.0

Kotlin 99.30% Swift 0.70%
android compose-multiplatform compose-ui ios jetpack-compose kmm kmm-library kotlin kotlin-multiplatform library

noober-2.0's Introduction

Noober 2.0 - Debugging Library for iOS & Android ๐Ÿš€

Noober 2.0 is the second version of Noober, a debugging library designed specifically for iOS. This version is powered by Kotlin Multiplatform Mobile (KMM) and Compose Multiplatform, allowing you to use a single library for both

Table of Contents

๐Ÿ” Features

Common

  • ๐ŸŒ Network Request Tracking: Noober 2.0 provides detailed information about all network requests made from your app, including their responses. You can also share this information with others for debugging purposes.

  • ๐Ÿ“ Custom Logs: Easily add custom logs to display important data during debugging, such as analytics events fired within your app.

  • ๐ŸŒ Change Base URL: Easily switch between different base URLs for network calls during debugging, streamlining testing in various environments.

  • ๐Ÿ”— Share User Properties via Deep Link: Share user properties stored in shared preferences (Android) or UserDefaults (iOS) with your teammates via deep links. This is especially useful for debugging and switching accounts without going through the authentication process repeatedly.

  • ๐Ÿ“Š Show and Edit Saved User Properties: Noober allows you to view and edit saved user properties without the need for additional customization.

Android

  • ๐Ÿ“ฆ Support for Multiple Shared Preferences: Noober 2.0 supports multiple shared preferences and encrypted shared preferences simultaneously.

  • ๐Ÿชฒ Auto-detect Crashes: Automatically detect crashes and display their stack traces in the Logs section. You can easily share crash details, including account information, via deep links.

  • ๐Ÿงน Clean Release Artifact: Ensure a clean release artifact with no traces of Noober in your final APK.

๐Ÿ–‡ Getting Started

Android

Step 1: Configure Maven Repository

To get started with Noober 2.0 on Android:

Add the Noober 2.0 dependency to your app-level build.gradle file:

dependencies {
    // For release builds
    releaseImplementation ("io.github.abhi165:noober-no-op-android:${version}")

    // For debug builds
    debugImplementation ("io.github.abhi165:noober-android:${version}")
    
    // Other dependencies...
}

iOS

To integrate Noober 2.0 into your iOS project, follow these steps:

Step 1: Add the following to your ~/.netrc file (create the file if it doesn't exist):

machine maven.pkg.github.com
  login [github username]
  password [your new personal access token]

Step 2: In Xcode, go to File > Add Package Dependency.

Step 3: Enter the repository URL for Noober 2.0.

That's it! Noober 2.0 will be added to your iOS project, allowing you to enjoy the benefits of cross-platform debugging.

๐Ÿš€ Initialization

Android

In your Application class:

Noober.start(this)

Add the NooberInterceptor to your OkHttpClient:

val client = OkHttpClient.Builder()
    .addInterceptor(NooberInterceptor())
    .build()

iOS

In your AppDelegate:

Noober().start()

โš™๏ธ Additional Setup

Android

  • Notification Permission: Starting with Android 13, you may need to request the android.permission.POST_NOTIFICATIONS permission to display notifications when Noober tracks network activity.

iOS

  • If you're using a 3rd-party library for network calls like Alamofire, add NoobProtocol to your URLSessionConfiguration:
let configuration: URLSessionConfiguration =  {
    let config = URLSessionConfiguration.default
    config.protocolClasses?.insert(Noober().getNoobProtocol()!, at: 0)
    return config
}()
  • To handle deep links on iOS, follow these steps:

Step 1: Open Xcode and go to Project Settings -> Info.

Step 2: Add a URL Scheme with the value "noober."

Step 3: Call Noober().importAccountFromNoob(url: NSURL) from your SceneDelegate (or App Delegate if you don't have AppDelegate).

  • To open Noober on iOS, you can use your own gesture and call Noober().toggle() or utilize Noober's UIWindow, which opens Noober when a shake gesture is detected. You can access the Noober window by calling Noober().getNoobWindow().

๐Ÿ› ๏ธ Utilizing Additional Features

  • To add logs, use:
Noober.log(tag: String, value: Any, isError: Boolean = false)
  • To set user properties for sharing via deep link:
Noober.setUserProperties(prop: List<NoobUserProperties>))

NoobUserProperties is a data class containing two keys:

  1. key: This is the identifier Noober uses to retrieve a specific data value (e.g., an authentication token) from shared preferences (Android) or UserDefaults (iOS).

  2. alternateKeyForCrossPlatform (Optional): In cases where the same data has different key names on Android and iOS, this attribute helps Noober map the keys correctly when sharing and receiving data via deep links.

๐Ÿ“ฝ๏ธ Demo

Android iOS
Screen.Recording.2023-09-11.at.9.14.46.AM.mov
Screen.Recording.2023-09-11.at.9.11.19.AM.mov

๐Ÿ› ๏ธ Built with

  • Kotlin: Programming language
  • Kotlin Multiplatform: For building multi-platform applications in the single codebase.
  • Jetpack/JetBrains Compose Multiplatform: For a shared UI between multi-platforms i.e. Android and iOS in this project.
  • Kotlinx Datetime: A multiplatform Kotlin library for working with date and time.
  • PreCompose: Compose Multiplatform library for Navigation
  • KMMBridge: KMMBridge is a set of Gradle tooling that facilitates publishing and consuming pre-built KMM (Kotlin Multiplatform Mobile) Xcode Framework binaries.

๐Ÿ“œ License


  Copyright 2023 ABHI165

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

noober-2.0's People

Contributors

noob-programmer1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.