Coder Social home page Coder Social logo

pikacode / ebforenotification Goto Github PK

View Code? Open in Web Editor NEW
553.0 553.0 124.0 12.33 MB

No more update, please use new pod ‘EBBannerView’ 不再更新,请使用新库 https://github.com/pikacode/EBBannerView

License: MIT License

Objective-C 9.16% Ruby 90.84%

ebforenotification's People

Contributors

daniele-xp avatar pikacode avatar yu0winter 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ebforenotification's Issues

Crash inside [EBBannerView removeWithAnimation]

Crash on EBBannerView.m line 171

Fatal Exception: NSInvalidArgumentException
-[SKProductInternal frame]: unrecognized selector sent to instance 0x1700959a0

Crash log:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x186872fd8 __exceptionPreprocess
1  libobjc.A.dylib                0x1852d4538 objc_exception_throw
2  CoreFoundation                 0x186879ef4 __methodDescriptionForSelector
3  CoreFoundation                 0x186876f4c ___forwarding___
4  CoreFoundation                 0x186772d2c _CF_forwarding_prep_0
5  UIKit                          0x18c99a88c -[UIView(Geometry) frame]
6  MyApp                          0x10009f634 __35-[EBBannerView removeWithAnimation]_block_invoke (EBBannerView.m:171)
7  UIKit                          0x18c9d74b8 +[UIView(UIViewAnimationWithBlocks) _setupAnimationWithDuration:delay:view:options:factory:animations:start:animationStateGenerator:completion:]
8  UIKit                          0x18cb1baf4 +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:completion:]
9  MyApp                          0x10009f4d8 -[EBBannerView removeWithAnimation] (EBBannerView.m:189)
10 Foundation                     0x187367760 __NSFireTimer
11 CoreFoundation                 0x186821a9c __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__
12 CoreFoundation                 0x1868217a0 __CFRunLoopDoTimer
13 CoreFoundation                 0x186821060 __CFRunLoopDoTimers
14 CoreFoundation                 0x18681ec84 __CFRunLoopRun
15 CoreFoundation                 0x18674ed94 CFRunLoopRunSpecific
16 GraphicsServices               0x1881b8074 GSEventRunModal
17 UIKit                          0x18ca07130 UIApplicationMain
18 MyApp                          0x100096da0 main (main.m:14)
19 libdyld.dylib                  0x18575d59c start

建议优先采用CFBundleDisplayName

有的应用BundleDisplayName才是真正显示的App应用名,Bundle name则采用工程名或者开发内部自定义名字。我不知道有多少应用是这样子,或者你开放API让开发者自己选择,显示的内容(图标和App名称)。THX!
ps:EBForeNotification抛砖引玉,告诉我一种实现的方向,感谢!

监听点击弹窗的事件、用户点击以后可以取到推送内容为空

2.监听点击弹窗的事件、用户点击以后可以取到推送内容、通过自定义推送中的 extra 字段处理自己的逻辑。如:
add observer for "EBBannerViewDidClick", handle extra key/value

{
    {
        aps:"alert":"推送内容",
        "sound":"sound",
        "badge":"3"
    },
        "key1":"跳转页面1"  //自定义此字段以跳转到相应页面
}

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(eBBannerViewDidClick:) name:EBBannerViewDidClick object:nil];
-(void)eBBannerViewDidClick:(NSNotification*)noti{
    if(noti[@"key1" == @"跳转页面1"]){
        //jump to page 1
    }
}

按照方法执行的,但是 noti获取是null

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle

i use it in a swift project
2016-08-10 16:59:45.948 qapp[44969:5712768] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/Library/Developer/CoreSimulator/Devices/D563093A-7F5F-4D40-84DD-94A63E13590E/data/Containers/Bundle/Application/4229F90D-0DE7-48E8-869A-AC88D517D747/qapp.app> (loaded)' with name 'EBBannerView''
*** First throw call stack:
(
0 CoreFoundation 0x00000001069acd85 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000108750deb objc_exception_throw + 48
2 CoreFoundation 0x00000001069accbd +[NSException raise:format:] + 205
3 UIKit 0x000000010759cc89 -[UINib instantiateWithOwner:options:] + 499
4 UIKit 0x000000010759f415 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 223
5 EBForeNotification 0x00000001062c48c7 +[EBForeNotification showBannerWithUserInfo:soundID:isIos10:] + 199
6 EBForeNotification 0x00000001062c4595 +[EBForeNotification handleRemoteNotification:soundID:isIos10:] + 517
7 qapp 0x0000000105f2fbaf TFC4qapp4Core16showNotificationfCSo8NSStringT + 655
8 qapp 0x0000000105f467e0 TFC4qapp13setcustomtime9tableViewfTCSo11UITableView23didSelectRowAtIndexPathCSo11NSIndexPath_T + 496
9 qapp 0x0000000105f468ef TToFC4qapp13setcustomtime9tableViewfTCSo11UITableView23didSelectRowAtIndexPathCSo11NSIndexPath_T + 79
10 UIKit 0x000000010731c1c6 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1887
11 UIKit 0x000000010731c41b -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 388
12 UIKit 0x00000001071e0f62 _runAfterCACommitDeferredBlocks + 317
13 UIKit 0x00000001071f4e4c _cleanUpAfterCAFlushAndRunDeferredBlocks + 95
14 UIKit 0x0000000107201147 _afterCACommitHandler + 90
15 CoreFoundation 0x00000001068d1c37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 23
16 CoreFoundation 0x00000001068d1ba7 __CFRunLoopDoObservers + 391
17 CoreFoundation 0x00000001068c77fb __CFRunLoopRun + 1147
18 CoreFoundation 0x00000001068c70f8 CFRunLoopRunSpecific + 488
19 GraphicsServices 0x000000010a7e3ad2 GSEventRunModal + 161
20 UIKit 0x00000001071d4f09 UIApplicationMain + 171
21 qapp 0x0000000105f51002 main + 114
22 libdyld.dylib 0x000000010da6892d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

Notification time is a constant

@pikacode Why is the notification time a constant string with (I'm guessing) chinese characters? Why doesn't it read the current time? Are we supposed to set it somehow?

Crash when receiving notification of type: {title: <title>, body: <body}

Notification 'alert' key can be both a string and a dictionary.
When sending the following notification:
{"aps" : { "alert" : { title: "title", body: "text" } } }

The application crashes on:

File: EBBannerView.m
-(NSString*) extractContentLabel:(NSDictionary*)userInfo{
    @throw [NSException exceptionWithName:NSInvalidArgumentException
                                   reason:@"aps['alert'] field malformed: it is neither a string nor a dictionary with key 'loc-key'"
                                 userInfo:nil];

Maybe it's a good idea never throw exceptions in production? It's good for debugging, but in production maybe the best thing would be logging it and not crashing the whole app.

Thanks! :)

Wrong appName parameter

This NSDictionary *infoDictionary = [[NSBundle bundleForClass:[self class]] infoDictionary]; should be like this: NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; in order for the app name to be inserted in the notifications, otherwise EBForeNotification is inserted.

Wrong fonts for iOS 10

The fonts for the iOS10 style notification are wrong:
The title should be System Light 13, and the message System Regular 15. Please update these to achieve a more authentic experience for the users.

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.