Coder Social home page Coder Social logo

baronha / ting Goto Github PK

View Code? Open in Web Editor NEW
236.0 236.0 14.0 784 KB

🍞 Flexible and customizable React Native toast/alert notifications with support for positioning, custom rendering, click handlers, and duration control. Written in Swift and Kotlin

License: MIT License

Kotlin 10.50% JavaScript 1.77% Ruby 3.97% Java 6.71% Swift 61.85% C 0.19% Objective-C 2.34% Objective-C++ 1.66% TypeScript 11.00%
alert android ios native-module new-architecture react-native toast toast-notifications

ting's Introduction

ting's People

Contributors

acetyld avatar baronha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ting's Issues

Compilation error on Ting.mm

Hello,

I'm running into a compilation error when compiling Ting.mm

CleanShot 2023-07-17 at 11 37 30@2x

See above screenshot. When I inspect this library's directory structure, I can see there is no such file names "ting-Swift.h". Is this intentional? @baronha

SIGTRAP when `'none'` is passed for `preset` property (alert)

SIGTRAP when 'none' is passed for preset property (alert() function).
done, error and spinner works without issues.

"@baronha/ting": "1.1.0"
"react-native": "0.72.1"

To reproduce:

import { alert } from '@baronha/ting'

alert({
  title: 'title',
  message: 'message',
  preset: 'none'
})

Produces:

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_pthread.dylib       	       0x1b1833778 pthread_setspecific + 48
1   libobjc.A.dylib               	       0x18004da88 AutoreleasePoolPage::moveTLSAutoreleaseToPool(ReturnAutoreleaseInfo) + 164
2   libobjc.A.dylib               	       0x180050548 AutoreleasePoolPage::push() + 44
3   CoreFoundation                	       0x180446160 _CFAutoreleasePoolPush + 16
4   CoreFoundation                	       0x1804a981c -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 184
5   native                        	       0x104852198 -[RCTNativeAnimatedNodesManager updateAnimations] + 44 (RCTNativeAnimatedNodesManager.m:475)
6   native                        	       0x104851fc8 -[RCTNativeAnimatedNodesManager stepAnimations:] + 396 (RCTNativeAnimatedNodesManager.m:459)
7   QuartzCore                    	       0x187c5b84c CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 808
8   QuartzCore                    	       0x187d62084 display_timer_callback(__CFMachPort*, void*, long, void*) + 336
9   CoreFoundation                	       0x1803664f0 __CFMachPortPerform + 172
10  CoreFoundation                	       0x18039b35c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
11  CoreFoundation                	       0x18039a97c __CFRunLoopDoSource1 + 496
12  CoreFoundation                	       0x180394ed4 __CFRunLoopRun + 2152
13  CoreFoundation                	       0x180394254 CFRunLoopRunSpecific + 584
14  GraphicsServices              	       0x188eb7c9c GSEventRunModal + 160
15  UIKitCore                     	       0x11f882ff0 -[UIApplication _run] + 868
16  UIKitCore                     	       0x11f886f3c UIApplicationMain + 124
17  native                        	       0x104234b7c main + 96 (main.m:7)
18  dyld_sim                      	       0x108069514 start_sim + 20
19  dyld                          	       0x107e45e50 start + 2544

Execution failed for task ':app:externalNativeBuildCleanDebug'

Execution failed for task ':app:externalNativeBuildCleanDebug'.

[CXX1409] //android/app/.cxx/Debug/6d4v1c6q/armeabi-v7a/android_gradle_build.json : expected buildFiles file '//node_modules/@baronha/ting/android/build/generated/source/codegen/jni/CMakeLists.txt' to exist

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

Expo Support

Hey man!

In the past we talked about this project, and how good it is =)
Currently we are running a development expo project, and we tried to use burnt, but it was missing stuff ur library has, such as globaly config and ability to change colors etc..

Is this something u are willing to look into? To add expo support?

Fatal Exception On Android

Description

Whenever I am trying to show a toast react native is throwing an exception

Fatal Exception: com.facebook.react.common.JavascriptException: Error: Exception in HostObject::get for prop 'Ting': java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference, js engine: hermes, stack:
anonymous@1:3844578
loadModuleImplementation@1:101879
guardedLoadModule@1:101433
metroRequire@1:101061
anonymous@1:3842863
loadModuleImplementation@1:101879
guardedLoadModule@1:101433
metroRequire@1:101061
anonymous@1:759163
loadModuleImplementation@1:101879
guardedLoadModule@1:101433
metroRequire@1:101061
anonymous@1:642845
loadModuleImplementation@1:101879
guardedLoadModule@1:101433
metroRequire@1:101061
anonymous@1:108317
loadModuleImplementation@1:101879
guardedLoadModule@1:101390
metroRequire@1:101061
global@1:100617

       at com.facebook.react.modules.core.ExceptionsManagerModule.reportException(:75)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:148)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke(:147)
       at com.facebook.jni.NativeRunnable.run(SourceFile)
       at android.os.Handler.handleCallback(Handler.java:942)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage()
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(:37)
       at java.lang.Thread.run(Thread.java:1012)

It's happening in Production build that too this issue is only visible on android devices.

Code

toast({ title: "Edit 📝", message: "Successful!!", position: "bottom", haptic: "success", backgroundColor: "#ffffff", messageColor: "#000000", preset: "done", })

React Native Version

0.72.3

Hi! I see u set 13 as minimun, which will deny iPhone 5s, any reason?

Specs satisfying the Ting (from ../node_modules/@baronha/ting) dependency were found, but they required a higher minimum deployment target.
Couldn't install Pods. Updating the Pods project and trying again...
Command pod install failed.
└─ Cause: CocoaPods could not find compatible versions for pod "Ting":
In Podfile:
Ting (from ../node_modules/@baronha/ting)

Specs satisfying the Ting (from ../node_modules/@baronha/ting) dependency were found, but they required a higher minimum deployment target.

CocoaPods could not find compatible versions for pod "Ting"

[!] CocoaPods could not find compatible versions for pod "Ting":
In Podfile:
Ting (from ../node_modules/@baronha/ting)

Specs satisfying the Ting (from ../node_modules/@baronha/ting) dependency were found, but they required a higher minimum deployment target.

react-native: 0.72

Not working with Ionic ?

Hello, when i try to installer your package in my cross-platform mobile app using Ionic:

I encounter this error: Could not locate Gemfile or .bundle/ directory

It's possible to install your package ?

Best regards
William

Task :baronha_ting:compileDebugKotlin

e: D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\src\main\java\com\ting\TingModule.kt: (44, 47): Unresolved reference: toast e: D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\src\main\java\com\ting\TingModule.kt: (47, 29): Unresolved reference: ToastTopAnim e: D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\src\main\java\com\ting\TingModule.kt: (50, 29): Unresolved reference: ToastBottomAnim e: D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\src\main\java\com\ting\TingModule.kt: (68, 33): Unresolved reference: toast e: D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\src\main\java\com\ting\TingModule.kt: (82, 47): Unresolved reference: alert e: D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\src\main\java\com\ting\TingModule.kt: (98, 30): Unresolved reference: AlertAnim e: D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\src\main\java\com\ting\TingModule.kt: (103, 33): Unresolved reference: alert
`
Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules@baronha\ting\android\build\intermediates\packaged_res\debug\drawable\done.xml:17: AAPT: error: resource color/done (aka com.yartaiaapp:color/done) not found.

 ERROR:D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\build\intermediates\packaged_res\debug\drawable\error.xml:8: AAPT: error: resource color/error (aka com.yartaiaapp:color/error) not found.    

 ERROR:D:\Tehman\dev\mernstack\rn\yarta-mobile\node_modules\@baronha\ting\android\build\intermediates\packaged_res\debug\layout\spinner.xml:10: AAPT: error: resource color/black (aka com.yartaiaapp:color/black) not found.   

`

@baronha can you assist me?

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.