NTESDemoConfig.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // NTESDemoConfig.m
  3. // NIM
  4. //
  5. // Created by amao on 4/21/15.
  6. // Copyright (c) 2015 Netease. All rights reserved.
  7. //
  8. #import "NTESDemoConfig.h"
  9. @interface NTESDemoConfig ()
  10. @end
  11. @implementation NTESDemoConfig
  12. + (instancetype)sharedConfig
  13. {
  14. static NTESDemoConfig *instance = nil;
  15. static dispatch_once_t onceToken;
  16. dispatch_once(&onceToken, ^{
  17. instance = [[NTESDemoConfig alloc] init];
  18. });
  19. return instance;
  20. }
  21. - (instancetype)init
  22. {
  23. if (self = [super init])
  24. {
  25. _appKey = @"45c6af3c98409b18a84451215d0bdd6e";
  26. _apiURL = @"https://app.netease.im/api";
  27. _apnsCername = @"ENTERPRISE";
  28. _pkCername = @"DEMO_PUSH_KIT";
  29. _redPacketConfig = [[NTESRedPacketConfig alloc] init];
  30. }
  31. return self;
  32. }
  33. - (NSString *)apiURL
  34. {
  35. NSAssert([[NIMSDK sharedSDK] isUsingDemoAppKey], @"只有 demo appKey 才能够使用这个API接口");
  36. return _apiURL;
  37. }
  38. - (void)registerConfig:(NSDictionary *)config
  39. {
  40. if (config[@"red_packet_online"])
  41. {
  42. _redPacketConfig.useOnlineEnv = [config[@"red_packet_online"] boolValue];
  43. }
  44. }
  45. @end
  46. @implementation NTESRedPacketConfig
  47. - (instancetype)init
  48. {
  49. self = [super init];
  50. if (self)
  51. {
  52. _useOnlineEnv = YES;
  53. // _aliPaySchemeUrl = @"alipay052969";
  54. // _weChatSchemeUrl = @"wx2a5538052969956e";
  55. }
  56. return self;
  57. }
  58. @end